Interface Permissible

    • Method Detail

      • isPermissionSet

        boolean isPermissionSet​(@NotNull
                                String name)
        Checks if this object contains an override for the specified permission, by fully qualified name
        Parameters:
        name - Name of the permission
        Returns:
        true if the permission is set, otherwise false
      • isPermissionSet

        boolean isPermissionSet​(@NotNull
                                Permission perm)
        Checks if this object contains an override for the specified Permission
        Parameters:
        perm - Permission to check
        Returns:
        true if the permission is set, otherwise false
      • hasPermission

        boolean hasPermission​(@NotNull
                              String name)
        Gets the value of the specified permission, if set.

        If a permission override is not set on this object, the default value of the permission will be returned.

        Parameters:
        name - Name of the permission
        Returns:
        Value of the permission
      • hasPermission

        boolean hasPermission​(@NotNull
                              Permission perm)
        Gets the value of the specified permission, if set.

        If a permission override is not set on this object, the default value of the permission will be returned

        Parameters:
        perm - Permission to get
        Returns:
        Value of the permission
      • addAttachment

        @NotNull
        PermissionAttachment addAttachment​(@NotNull
                                           Plugin plugin,
                                           @NotNull
                                           String name,
                                           boolean value)
        Adds a new PermissionAttachment with a single permission by name and value
        Parameters:
        plugin - Plugin responsible for this attachment, may not be null or disabled
        name - Name of the permission to attach
        value - Value of the permission
        Returns:
        The PermissionAttachment that was just created
      • addAttachment

        @NotNull
        PermissionAttachment addAttachment​(@NotNull
                                           Plugin plugin)
        Adds a new empty PermissionAttachment to this object
        Parameters:
        plugin - Plugin responsible for this attachment, may not be null or disabled
        Returns:
        The PermissionAttachment that was just created
      • addAttachment

        @Nullable
        PermissionAttachment addAttachment​(@NotNull
                                           Plugin plugin,
                                           @NotNull
                                           String name,
                                           boolean value,
                                           int ticks)
        Temporarily adds a new PermissionAttachment with a single permission by name and value
        Parameters:
        plugin - Plugin responsible for this attachment, may not be null or disabled
        name - Name of the permission to attach
        value - Value of the permission
        ticks - Amount of ticks to automatically remove this attachment after
        Returns:
        The PermissionAttachment that was just created
      • addAttachment

        @Nullable
        PermissionAttachment addAttachment​(@NotNull
                                           Plugin plugin,
                                           int ticks)
        Temporarily adds a new empty PermissionAttachment to this object
        Parameters:
        plugin - Plugin responsible for this attachment, may not be null or disabled
        ticks - Amount of ticks to automatically remove this attachment after
        Returns:
        The PermissionAttachment that was just created
      • recalculatePermissions

        void recalculatePermissions()
        Recalculates the permissions for this object, if the attachments have changed values.

        This should very rarely need to be called from a plugin.

      • getEffectivePermissions

        @NotNull
        Set<PermissionAttachmentInfo> getEffectivePermissions()
        Gets a set containing all of the permissions currently in effect by this object
        Returns:
        Set of currently effective permissions