Interface IPermissionsManagerSpigot
- All Superinterfaces:
IPermissionsManager
- All Known Implementing Classes:
VaultManager
This interface is used to provide a permissions manager for Spigot.
-
Method Summary
Modifier and TypeMethodDescriptiongetMaxPermissionSuffix(org.bukkit.entity.Player player, String permissionBase) Gets the highest numerical permission suffix of the base permission node it can find, if any.booleanhasBypassPermissionsForAttribute(org.bukkit.entity.Player player, StructureAttribute structureAttribute) Checks if a player has bypass permissions for a specific attribute.booleanhasPermission(org.bukkit.entity.Player player, String permissionNode) Checks if a player has a certain permission node or not.hasPermissionOffline(org.bukkit.World world, org.bukkit.OfflinePlayer player, String permission) Asynchronously checks if an (offline) player has a certain permission node.booleanisOp(org.bukkit.entity.Player player) Checks if the given player is a server operator or not.Methods inherited from interface nl.pim16aap2.animatedarchitecture.core.api.IPermissionsManager
getMaxPermissionSuffix, hasBypassPermissionsForAttribute, hasPermission, hasPermissionToCreateStructure, isOp
-
Method Details
-
getMaxPermissionSuffix
Gets the highest numerical permission suffix of the base permission node it can find, if any.For example, if a player has "permission.node.1" and "permission.node.2", this method would return (the OptionalInt of) 2.
- Parameters:
player- The player whose permissions to check.permissionBase- The base permission. In the example above, this would be "permission.node." (note the '.' at the end).- Returns:
- The highest numerical suffix of the base permission node if it exists, otherwise an empty OptionalInt.
-
hasPermission
Checks if a player has a certain permission node or not.- Parameters:
player- The player whose permissions to check.This player CANNOT be offline or a fake player! Use
hasPermissionOffline(World, OfflinePlayer, String)instead.permissionNode- The permission node to check.- Returns:
- True if the player has the permission node.
- Throws:
RuntimeException- If the provided player is offline or a fake player.
-
hasPermissionOffline
CompletableFuture<Boolean> hasPermissionOffline(org.bukkit.World world, org.bukkit.OfflinePlayer player, String permission) Asynchronously checks if an (offline) player has a certain permission node.- Parameters:
world- The world to check in.player- The player whose permissions to check.permission- The permission node to check.- Returns:
- A CompletableFuture that will be completed with true if the player has the permission node, false
-
hasBypassPermissionsForAttribute
boolean hasBypassPermissionsForAttribute(org.bukkit.entity.Player player, StructureAttribute structureAttribute) Checks if a player has bypass permissions for a specific attribute.Having bypass permissions means that a player is able to access a given attribute for structures even if they are not co-owners of those structures.
- Parameters:
player- The player whose permissions to check.structureAttribute- The attribute of the Structure for which to verify if the player has bypass permissions.- Returns:
- True if the player has bypass permissions for the attribute.
-
isOp
boolean isOp(org.bukkit.entity.Player player) Checks if the given player is a server operator or not.- Parameters:
player- The player to check.- Returns:
- True if the player is a server operator on this server.
-