Class TownyPermissionSource
java.lang.Object
com.palmergames.bukkit.towny.permissions.TownyPermissionSource
- Direct Known Subclasses:
BukkitPermSource
,GroupManagerSource
,NullPermSource
,VaultPermSource
- Author:
- ElgarL Manager for Permission provider plugins
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.anjocaido.groupmanager.GroupManager
protected Towny
protected TownySettings
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
getEffectivePermIntNode
(String playerName, String node) abstract int
getGroupPermissionIntNode
(String playerName, String node) abstract String
getPlayerGroup
(org.bukkit.entity.Player player) abstract int
getPlayerPermissionIntNode
(String playerName, String node) abstract String
getPlayerPermissionStringNode
(String playerName, String node) abstract String
getPrefixSuffix
(Resident resident, String node) boolean
hasAllTownOverride
(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has an all town override to permit this action.boolean
hasOwnTownOverride
(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has an own town (or all town) override to permit this action.boolean
hasTownOwnedOverride
(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has a 'town owned', 'Own town' or 'all town' override to permit this action.boolean
hasWildOverride
(TownyWorld world, org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has permission to permit this action in the wilderness.boolean
isTownyAdmin
(@NotNull org.bukkit.permissions.Permissible permissible) The final destination for isTownyAdmin tests.boolean
testPermission
(org.bukkit.permissions.Permissible permissible, String perm) Primary test for a permission node, used throughout Towny.void
testPermissionOrThrow
(org.bukkit.permissions.Permissible permissible, String perm) A method to test if a Permissible has a specific permission node.void
testPermissionOrThrow
(org.bukkit.permissions.Permissible permissible, String perm, Translatable errormsg) A method to test if a Permissible has a specific permission node, which will show a non-generic no permission message if the Permissible does not have the node.boolean
unclaimedZoneAction
(TownyWorld world, org.bukkit.Material material, TownyPermission.ActionType action)
-
Field Details
-
settings
-
plugin
-
groupManager
protected org.anjocaido.groupmanager.GroupManager groupManager
-
-
Constructor Details
-
TownyPermissionSource
public TownyPermissionSource()
-
-
Method Details
-
getPrefixSuffix
-
getGroupPermissionIntNode
-
getPlayerPermissionIntNode
-
getPlayerGroup
-
getPlayerPermissionStringNode
-
getEffectivePermIntNode
-
hasWildOverride
public boolean hasWildOverride(TownyWorld world, org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has permission to permit this action in the wilderness.- Parameters:
world
- TownyWorld object.player
- Player.material
- Material being tested.action
- Action type.- Returns:
- true if the action is permitted.
-
unclaimedZoneAction
public boolean unclaimedZoneAction(TownyWorld world, org.bukkit.Material material, TownyPermission.ActionType action) -
hasOwnTownOverride
public boolean hasOwnTownOverride(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has an own town (or all town) override to permit this action.- Parameters:
player
- Player.material
- Material being tested.action
- ActionType.- Returns:
- true if the action is permitted.
-
hasTownOwnedOverride
public boolean hasTownOwnedOverride(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has a 'town owned', 'Own town' or 'all town' override to permit this action.- Parameters:
player
- Player.material
- Material being tested.action
- ActionType.- Returns:
- true if action is permitted.
-
hasAllTownOverride
public boolean hasAllTownOverride(org.bukkit.entity.Player player, org.bukkit.Material material, TownyPermission.ActionType action) Test if the player has an all town override to permit this action.- Parameters:
player
- Player.material
- Material being tested.action
- ActionType.- Returns:
- true if the action is permitted.
-
isTownyAdmin
public boolean isTownyAdmin(@NotNull @NotNull org.bukkit.permissions.Permissible permissible) The final destination for isTownyAdmin tests.- Parameters:
permissible
- Permissible object, a player or a console.- Returns:
- true if the permissible is null or op or has the towny.admin node.
-
testPermissionOrThrow
public void testPermissionOrThrow(org.bukkit.permissions.Permissible permissible, String perm) throws NoPermissionException A method to test if a Permissible has a specific permission node.- Parameters:
permissible
- Permissible object, a player or a console.perm
- String representing the node to test for.- Throws:
NoPermissionException
- thrown when the player does not have the required node.
-
testPermissionOrThrow
public void testPermissionOrThrow(org.bukkit.permissions.Permissible permissible, String perm, Translatable errormsg) throws NoPermissionException A method to test if a Permissible has a specific permission node, which will show a non-generic no permission message if the Permissible does not have the node.- Parameters:
permissible
- Permissible object, a player or a console.perm
- String representing the node to test for.errormsg
- Translatable used when the Permissible has no permission.- Throws:
NoPermissionException
- thrown when the player does not have the required node, with custom Translatable message.
-
testPermission
Primary test for a permission node, used throughout Towny.- Parameters:
permissible
- Permissible to check.perm
- Permission node to check for.- Returns:
- true if the player has the permission node or is considered an admin.
-