Class Permissions

java.lang.Object
com.plotsquared.core.util.Permissions

@Deprecated(forRemoval=true, since="6.9.3") public class Permissions extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes
The Permissions class handles checking user permissions.
- This will respect * nodes and plots.admin and can be used to check permission ranges (e.g. plots.plot.5)
- Checking the PlotPlayer class directly will not take the above into account
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static boolean
    hasPermission(PlotPlayer<?> player, Permission permission, boolean notify)
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static boolean
    hasPermission(PlotPlayer<?> player, String permission, boolean notify)
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static int
    hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range)
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.
    static int
    hasPermissionRange(PlotPlayer<?> player, String stub, int range)
    Deprecated, for removal: This API element is subject to removal in a future version.
    all logic that may once have been in the class lives elsewhere.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Permissions

      public Permissions()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • hasPermission

      @Deprecated(forRemoval=true, since="6.9.3") public static boolean hasPermission(PlotPlayer<?> player, Permission permission, boolean notify)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PlotPlayer.hasPermission(String, boolean)
    • hasPermission

      @Deprecated(forRemoval=true, since="6.9.3") public static boolean hasPermission(@NonNull PermissionHolder caller, @NonNull Permission permission)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PermissionHolder.hasPermission(Permission)
      Check if the owner of the profile has a given (global) permission
      Parameters:
      caller - permission holder
      permission - Permission
      Returns:
      true if the owner has the given permission, else false
    • hasPermission

      @Deprecated(forRemoval=true, since="6.9.3") public static boolean hasPermission(@NonNull PermissionHolder caller, @NonNull String permission)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PermissionHolder.hasPermission(String)
      Check if the owner of the profile has a given (global) permission. There is no guarantee that per-world permissions will be checked because unmaintained crap plugins like PEX exist.
      Parameters:
      caller - permission holder
      permission - Permission
      Returns:
      true if the owner has the given permission, else false
    • hasKeyedPermission

      @Deprecated(forRemoval=true, since="6.9.3") public static boolean hasKeyedPermission(@NonNull PermissionHolder caller, @NonNull String permission, @NonNull String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PermissionHolder.hasKeyedPermission(String, String)
      Check if the owner of the profile has a given (global) keyed permission. Checks both permission.key and permission.*
      Parameters:
      caller - permission holder
      permission - Permission
      key - Permission "key"
      Returns:
      true if the owner has the given permission, else false
      Since:
      6.0.10
    • hasPermission

      @Deprecated(forRemoval=true, since="6.9.3") public static boolean hasPermission(PlotPlayer<?> player, String permission, boolean notify)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PlotPlayer.hasPermission(String, boolean)
      Checks if a PlotPlayer has a permission, and optionally send the no permission message if applicable.
      Parameters:
      player - permission holder
      permission - permission
      notify - if to notify the permission holder
      Returns:
      if permission is had
    • hasPermissionRange

      @Deprecated(forRemoval=true, since="6.9.3") public static int hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PermissionHolder.hasPermissionRange(Permission, int)
    • hasPermissionRange

      @Deprecated(forRemoval=true, since="6.9.3") public static int hasPermissionRange(PlotPlayer<?> player, String stub, int range)
      Deprecated, for removal: This API element is subject to removal in a future version.
      all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed classes. Use PermissionHolder.hasPermissionRange(String, int)
      Check the highest permission a PlotPlayer has within a specified range.
      - Excessively high values will lag
      - The default range that is checked is Settings.Limit.MAX_PLOTS
      Parameters:
      player - Player to check for
      stub - The permission stub to check e.g. for `plots.plot.#` the stub is `plots.plot`
      range - The range to check
      Returns:
      The highest permission they have within that range