Package com.sk89q.worldedit.util.auth
Interface Subject
- All Known Subinterfaces:
Actor
,Player
,SessionOwner
- All Known Implementing Classes:
AbstractNonPlayerActor
,AbstractPlayerActor
public interface Subject
A subject has authorization attached to it.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(String permission) Check whether this subject has been granted the given permission and throw an exception on error.String[]
Get a list of groups that this subject is a part of.boolean
hasPermission
(String permission) Return whether this subject has the given permission.
-
Method Details
-
getGroups
String[] getGroups()Get a list of groups that this subject is a part of.- Returns:
- an array containing a group name per entry
-
checkPermission
Check whether this subject has been granted the given permission and throw an exception on error.- Parameters:
permission
- the permission- Throws:
AuthorizationException
- thrown if not permitted
-
hasPermission
Return whether this subject has the given permission.- Parameters:
permission
- the permission- Returns:
- true if permission is granted
-