Contents
Interface PermissionHolder
- All Known Subinterfaces:
CommandSender
- All Known Implementing Classes:
ConsoleSender, EditorClient, PlayerRef
public interface PermissionHolder
An interface for anything that can hold permissions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasPermission(PermissionQuery query) Determines whether the associated instance has the given permission.default booleanhasPermission(PermissionQuery query, boolean def) booleanhasPermission(String id) Whether their attached permissions contains the id.booleanhasPermission(String id, boolean def) Determines whether the associated instance has the given permission.
-
Method Details
-
hasPermission
Whether their attached permissions contains the id. This will also attempt to find wildcard matches.For example, if their permissions contain "hytale.*", the check "hytale.permission-test" will return
If they have the root "*" permission, all returns will betrue.true.- Parameters:
id- the permission.- Returns:
trueif they have the permission,falseotherwise.
-
hasPermission
Determines whether the associated instance has the given permission.- Parameters:
id- The identifier of the permission.def- The default value to return if the player does not have the permission.- Returns:
trueif they have the permission,falseotherwise.
-
hasPermission
Determines whether the associated instance has the given permission.A holder that resolves permissions itself should override this, because a lookup built once and reused costs an order of magnitude less than one built for each check.
- Parameters:
query- The lookup for the permission.- Returns:
trueif they have the permission,falseotherwise.
-
hasPermission
- Parameters:
query- The lookup for the permission.def- The default value to return if nothing decides.- Returns:
trueif they have the permission,falseotherwise.- See Also:
-