Class StargatePermissionManager

java.lang.Object
org.sgrewritten.stargate.manager.StargatePermissionManager
All Implemented Interfaces:
PermissionManager

public class StargatePermissionManager extends Object implements PermissionManager
Manages the plugin's permissions.
Author:
Thorin, Pheotis
  • Constructor Details

    • StargatePermissionManager

      public StargatePermissionManager(org.bukkit.entity.Entity target, LanguageManager languageManager)
      Instantiates a new permission manager
      Parameters:
      target -

      The entity to check permissions for

      languageManager -

      The manager that deals with the message

  • Method Details

    • returnDisallowedFlags

      public Set<PortalFlag> returnDisallowedFlags(Set<PortalFlag> flags)
      Description copied from interface: PermissionManager
      Gets all flags usable by the entity
      Specified by:
      returnDisallowedFlags in interface PermissionManager
      Parameters:
      flags -

      The flags to check if the entity can use

      Returns:

      The flags usable by the entity

    • hasAccessPermission

      public boolean hasAccessPermission(RealPortal portal)
      Description copied from interface: PermissionManager
      Check if entity has permission to access portal
      Specified by:
      hasAccessPermission in interface PermissionManager
      Parameters:
      portal -

      The portal to be accessed

      Returns:

      If entity has permission

    • hasCreatePermissions

      public boolean hasCreatePermissions(RealPortal portal)
      Description copied from interface: PermissionManager
      Check if entity has permission to create portal
      Specified by:
      hasCreatePermissions in interface PermissionManager
      Parameters:
      portal -

      The portal to be created

      Returns:

      If entity has permission

    • hasDestroyPermissions

      public boolean hasDestroyPermissions(RealPortal portal)
      Description copied from interface: PermissionManager
      Check if entity has permission to destroy portal
      Specified by:
      hasDestroyPermissions in interface PermissionManager
      Parameters:
      portal -

      The portal to be destroyed

      Returns:

      If entity has permission

    • hasOpenPermissions

      public boolean hasOpenPermissions(RealPortal entrance, Portal exit)
      Description copied from interface: PermissionManager
      Check if entity has permission to open portal
      Specified by:
      hasOpenPermissions in interface PermissionManager
      Parameters:
      entrance -

      The portal the entity is opening

      exit -

      The destination portal

      Returns:

      If entity has permission

    • hasTeleportPermissions

      public boolean hasTeleportPermissions(RealPortal entrance)
      Description copied from interface: PermissionManager
      Check if the entity has permission to teleport through portal
      Specified by:
      hasTeleportPermissions in interface PermissionManager
      Parameters:
      entrance -

      The portal the entity is entering

      Returns:

      If entity has permission

    • canCreateInNetwork

      public boolean canCreateInNetwork(String network, NetworkType type)
      Description copied from interface: PermissionManager
      Checks whether the entity is allowed to create stargates in the given network
      Specified by:
      canCreateInNetwork in interface PermissionManager
      Parameters:
      network -

      The name of the network to check

      type -

      The type if the network to check

      Returns:

      True if the entity is allowed to create stargates

    • getDenyMessage

      public String getDenyMessage()
      Description copied from interface: PermissionManager
      Gets the deny-message to display if a previous permission check returned false
      Specified by:
      getDenyMessage in interface PermissionManager
      Returns:

      The message to display when telling the player the action has been denied