Package io.manebot.security
Class Permission
- java.lang.Object
-
- io.manebot.security.Permission
-
public final class Permission extends java.lang.Object
-
-
Method Summary
Modifier and Type Method Description static voidcheckPermission(Permission permission)Checks that the current process has a specific permission, defaulting to deny if no permission is defined.static voidcheckPermission(Permission permission, Grant defaultGrant)Checks that the current process has a specific permission, defaulting to deny if no permission is defined.static voidcheckPermission(java.lang.String node)Checks that the current process has a specific permission, defaulting to deny if no permission is defined.static voidcheckPermission(java.lang.String node, Grant defaultGrant)Checks that the current process has a specific permission, defaulting to deny if no permission is defined.booleanequals(java.lang.Object b)static Permissionget(java.lang.String node)Gets or creates a permission in the permission node tree.java.lang.StringgetNode()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getNode
public java.lang.String getNode()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object b)
- Overrides:
equalsin classjava.lang.Object
-
get
public static Permission get(java.lang.String node)
Gets or creates a permission in the permission node tree.- Parameters:
node- node to create.- Returns:
- Permission instance.
-
checkPermission
public static void checkPermission(java.lang.String node) throws java.lang.IllegalStateException, java.lang.SecurityExceptionChecks that the current process has a specific permission, defaulting to deny if no permission is defined.- Parameters:
node- node to check.- Throws:
java.lang.IllegalStateException- if the current thread is not a member of the virtual process system, or if that thread is not logged in.java.lang.SecurityException- if the user associated with the current thread does not have the permission node.
-
checkPermission
public static void checkPermission(java.lang.String node, Grant defaultGrant) throws java.lang.IllegalStateException, java.lang.SecurityExceptionChecks that the current process has a specific permission, defaulting to deny if no permission is defined.- Parameters:
node- node to check.defaultGrant- default grant behavior. When DENY, users with no matching permission node are denied. When ALLOW, these users are allowed.- Throws:
java.lang.IllegalStateException- if the current thread is not a member of the virtual process system, or if that thread is not logged in.java.lang.SecurityException- if the user associated with the current thread does not have the permission node.
-
checkPermission
public static void checkPermission(Permission permission) throws java.lang.IllegalStateException, java.lang.SecurityException
Checks that the current process has a specific permission, defaulting to deny if no permission is defined.- Parameters:
permission- Permission instance to check.- Throws:
java.lang.IllegalStateException- if the current thread is not a member of the virtual process system, or if that thread is not logged in.java.lang.SecurityException- if the user associated with the current thread does not have the permission node.
-
checkPermission
public static void checkPermission(Permission permission, Grant defaultGrant) throws java.lang.IllegalStateException, java.lang.SecurityException
Checks that the current process has a specific permission, defaulting to deny if no permission is defined.- Parameters:
permission- Permission instance to check.defaultGrant- default grant behavior. When DENY, users with no matching permission node are denied. When ALLOW, these users are allowed.- Throws:
java.lang.IllegalStateException- if the current thread is not a member of the virtual process system, or if that thread is not logged in.java.lang.SecurityException- if the user associated with the current thread does not have the permission node.
-
-