Class TownyPermissionSource

java.lang.Object
com.palmergames.bukkit.towny.permissions.TownyPermissionSource
Direct Known Subclasses:
BukkitPermSource, GroupManagerSource, NullPermSource, VaultPermSource

public abstract class TownyPermissionSource extends Object
Author:
ElgarL Manager for Permission provider plugins
  • Field Details

    • settings

      protected TownySettings settings
    • plugin

      protected Towny plugin
    • groupManager

      protected org.anjocaido.groupmanager.GroupManager groupManager
  • Constructor Details

    • TownyPermissionSource

      public TownyPermissionSource()
  • Method Details

    • getPrefixSuffix

      public abstract String getPrefixSuffix(Resident resident, String node)
    • getGroupPermissionIntNode

      public abstract int getGroupPermissionIntNode(String playerName, String node)
    • getPlayerPermissionIntNode

      public abstract int getPlayerPermissionIntNode(String playerName, String node)
    • getPlayerGroup

      public abstract String getPlayerGroup(org.bukkit.entity.Player player)
    • getPlayerPermissionStringNode

      public abstract String getPlayerPermissionStringNode(String playerName, String node)
    • getEffectivePermIntNode

      protected int getEffectivePermIntNode(String playerName, String node)
    • 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

      public boolean testPermission(org.bukkit.permissions.Permissible permissible, String perm)
      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.