Package net.alpenblock.bungeeperms
Class PermissionsChecker
- java.lang.Object
-
- net.alpenblock.bungeeperms.PermissionsChecker
-
- Direct Known Subclasses:
BukkitPermissionsChecker
,BungeePermissionsChecker
,VelocityPermissionsChecker
public class PermissionsChecker extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PermissionsChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
has(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission (globally).boolean
hasOnServer(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission on the current server.boolean
hasOnServerInWorld(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission on the current server and in the current world.boolean
hasOrConsole(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission (globally).boolean
hasOrConsoleOnServer(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission on the current server.boolean
hasOrConsoleOnServerInWorld(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission on the current server and in the current world.boolean
hasPerm(java.lang.String sender, java.lang.String permission)
Checks if a user (no console) has a specific permission (globally).boolean
hasPerm(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission (globally).boolean
hasPermOnServer(java.lang.String sender, java.lang.String permission, java.lang.String server)
Checks if a user (no console) has a specific permission on the given server.boolean
hasPermOnServer(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission.boolean
hasPermOnServerInWorld(java.lang.String sender, java.lang.String permission, java.lang.String server, java.lang.String world)
Checks if a user (no console) has a specific permission on the given server and in the given world.boolean
hasPermOnServerInWorld(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission.boolean
hasPermOrConsole(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission (globally).boolean
hasPermOrConsoleOnServer(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission.boolean
hasPermOrConsoleOnServerInWorld(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission.protected PermissionsManager
pm()
-
-
-
Method Detail
-
hasPerm
public boolean hasPerm(java.lang.String sender, java.lang.String permission)
Checks if a user (no console) has a specific permission (globally).- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOnServer
public boolean hasPermOnServer(java.lang.String sender, java.lang.String permission, java.lang.String server)
Checks if a user (no console) has a specific permission on the given server.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to checkserver
- the server for additional permissions- Returns:
- the result of the permission check
-
hasPermOnServerInWorld
public boolean hasPermOnServerInWorld(java.lang.String sender, java.lang.String permission, java.lang.String server, java.lang.String world)
Checks if a user (no console) has a specific permission on the given server and in the given world.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to checkserver
- the server for additional permissionsworld
- the world for additional permissions- Returns:
- the result of the permission check
-
hasPerm
public boolean hasPerm(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission (globally).- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOrConsole
public boolean hasPermOrConsole(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission (globally). If sender is console this function return true.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOnServer
public boolean hasPermOnServer(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission. Server is fetched automatically.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOrConsoleOnServer
public boolean hasPermOrConsoleOnServer(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission. Server is fetched automatically.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOnServerInWorld
public boolean hasPermOnServerInWorld(Sender sender, java.lang.String permission)
Checks if a user (no console) has a specific permission. Server and world are fetched automatically.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
hasPermOrConsoleOnServerInWorld
public boolean hasPermOrConsoleOnServerInWorld(Sender sender, java.lang.String permission)
Checks if a user (or console) has a specific permission. Server and world are fetched automatically.- Parameters:
sender
- the command sender to check a permission forpermission
- the permission to check- Returns:
- the result of the permission check
-
has
public boolean has(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission (globally).- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
hasOrConsole
public boolean hasOrConsole(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission (globally).- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
hasOnServer
public boolean hasOnServer(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission on the current server.- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
hasOrConsoleOnServer
public boolean hasOrConsoleOnServer(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission on the current server.- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
hasOnServerInWorld
public boolean hasOnServerInWorld(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (no console) has a specific permission on the current server and in the current world.- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
hasOrConsoleOnServerInWorld
public boolean hasOrConsoleOnServerInWorld(Sender sender, java.lang.String perm, boolean msg)
Checks if a user (or console) has a specific permission on the current server and in the current world.- Parameters:
sender
- the command sender to check a permission forperm
- the permission to checkmsg
- if a no-permission message is send to the sender- Returns:
- the result of the permission check
-
pm
protected PermissionsManager pm()
-
-