Class DefaultPermissionManagement

    • Constructor Detail

      • DefaultPermissionManagement

        public DefaultPermissionManagement()
    • Method Detail

      • canBeOverwritten

        public boolean canBeOverwritten()
        Description copied from interface: IPermissionManagement
        Gets if this permission management can be overridden.
        Specified by:
        canBeOverwritten in interface IPermissionManagement
        Returns:
        if this permission management can be overridden.
      • getUser

        @Deprecated
        public java.util.List<IPermissionUser> getUser​(java.lang.String name)
        Deprecated.
        Description copied from interface: IPermissionManagement
        Gets all users with the given name.
        Specified by:
        getUser in interface IPermissionManagement
        Parameters:
        name - the name of the permission users to get.
        Returns:
        all permission users with the given name.
      • getUserByGroup

        @Deprecated
        public java.util.Collection<IPermissionUser> getUserByGroup​(java.lang.String group)
        Deprecated.
      • testPermissionGroup

        public boolean testPermissionGroup​(@Nullable
                                           @Nullable IPermissionGroup permissionGroup)
        Description copied from interface: IPermissionManagement
        Removes the timed-out permissions of the given permissionGroup.
        Specified by:
        testPermissionGroup in interface IPermissionManagement
        Parameters:
        permissionGroup - the group to check.
        Returns:
        true if at least one permission was removed.
      • testPermissionUser

        public boolean testPermissionUser​(@Nullable
                                          @Nullable IPermissionUser permissionUser)
        Description copied from interface: IPermissionManagement
        Removes all timed-out permissions and groups of the given permissionUser.
        Specified by:
        testPermissionUser in interface IPermissionManagement
        Parameters:
        permissionUser - the permission user to check.
        Returns:
        true if at least one permission was removed.
      • testPermissible

        public boolean testPermissible​(@Nullable
                                       @Nullable IPermissible permissible)
        Description copied from interface: IPermissionManagement
        Removes the timed-out permissions of the given permissible.
        Specified by:
        testPermissible in interface IPermissionManagement
        Parameters:
        permissible - the permissible to check.
        Returns:
        true if at least one permission was removed.
      • getGroups

        @NotNull
        public @NotNull java.util.Collection<IPermissionGroup> getGroups​(@Nullable
                                                                         @Nullable IPermissible permissible)
        Description copied from interface: IPermissionManagement
        Gets the extended groups of the specified group.
        Specified by:
        getGroups in interface IPermissionManagement
        Parameters:
        permissible - the permissible to get the extended groups of.
        Returns:
        the extended groups of the given permissible.
      • getPermissionResult

        @NotNull
        public @NotNull PermissionCheckResult getPermissionResult​(@NotNull
                                                                  @NotNull IPermissible permissible,
                                                                  @NotNull
                                                                  @NotNull java.lang.String group,
                                                                  @NotNull
                                                                  @NotNull Permission permission)
        Description copied from interface: IPermissionManagement
        Checks if the given permissible has the given permission.
        Specified by:
        getPermissionResult in interface IPermissionManagement
        Parameters:
        permissible - the permissible to check if the permission is set.
        group - the group to get the permissions on.
        permission - the permission to check.
        Returns:
        the check result. PermissionCheckResult.DENIED indicates that there was no allowing/forbidding permission.
      • getPermissionResult

        @NotNull
        public @NotNull PermissionCheckResult getPermissionResult​(@NotNull
                                                                  @NotNull IPermissible permissible,
                                                                  @NotNull
                                                                  @NotNull java.lang.Iterable<java.lang.String> groups,
                                                                  @NotNull
                                                                  @NotNull Permission permission)
        Description copied from interface: IPermissionManagement
        Checks if the given permissible has the given permission.
        Specified by:
        getPermissionResult in interface IPermissionManagement
        Parameters:
        permissible - the permissible to check if the permission is set.
        groups - the groups to get the permissions on.
        permission - the permission to check.
        Returns:
        the check result. PermissionCheckResult.DENIED indicates that there was no allowing/forbidding permission.
      • getPermissionResult

        @NotNull
        public @NotNull PermissionCheckResult getPermissionResult​(@NotNull
                                                                  @NotNull IPermissible permissible,
                                                                  @NotNull
                                                                  @NotNull java.lang.String[] groups,
                                                                  @NotNull
                                                                  @NotNull Permission permission)
        Description copied from interface: IPermissionManagement
        Checks if the given permissible has the given permission.
        Specified by:
        getPermissionResult in interface IPermissionManagement
        Parameters:
        permissible - the permissible to check if the permission is set.
        groups - the groups to get the permissions on.
        permission - the permission to check.
        Returns:
        the check result. PermissionCheckResult.DENIED indicates that there was no allowing/forbidding permission.
      • findHighestPermission

        @Nullable
        public @Nullable Permission findHighestPermission​(@NotNull
                                                          @NotNull java.util.Collection<Permission> permissions,
                                                          @NotNull
                                                          @NotNull Permission permission)
        Description copied from interface: IPermissionManagement
        Finds the highest permission (sorted by the potency) in the given permissions array using the given permission potency as the starting point.
        Specified by:
        findHighestPermission in interface IPermissionManagement
        Parameters:
        permissions - the permissions to check through.
        permission - the starting point for the check to run.
        Returns:
        the highest permission in the given permission or null if there is no permission with a higher potency in the given collection
      • collectAllPermissions

        protected java.util.Collection<Permission> collectAllPermissions​(@NotNull
                                                                         @NotNull IPermissible permissible,
                                                                         @Nullable
                                                                         @Nullable java.lang.String[] groups)
      • collectAllPermissionsTo

        protected java.util.Collection<Permission> collectAllPermissionsTo​(@NotNull
                                                                           @NotNull java.util.Collection<Permission> target,
                                                                           @NotNull
                                                                           @NotNull IPermissible permissible,
                                                                           @Nullable
                                                                           @Nullable java.lang.String[] groups)
      • collectAllGroupPermissionsInto

        protected void collectAllGroupPermissionsInto​(@NotNull
                                                      @NotNull java.util.Collection<Permission> target,
                                                      @NotNull
                                                      @NotNull java.util.Collection<IPermissionGroup> groups,
                                                      @Nullable
                                                      @Nullable java.lang.String[] taskGroups,
                                                      @NotNull
                                                      @NotNull java.util.Collection<java.lang.String> travelledGroups)
      • collectPermissionsInto

        protected void collectPermissionsInto​(@NotNull
                                              @NotNull java.util.Collection<Permission> permissions,
                                              @NotNull
                                              @NotNull IPermissible permissible,
                                              @Nullable
                                              @Nullable java.lang.String[] groups)
      • tryExtendedGroups

        @Deprecated
        @ScheduledForRemoval
        public PermissionCheckResult tryExtendedGroups​(@NotNull
                                                       @NotNull java.lang.String firstGroup,
                                                       @Nullable
                                                       @Nullable IPermissionGroup permissionGroup,
                                                       @NotNull
                                                       @NotNull Permission permission,
                                                       int layer)
        Deprecated.
        has no use internally anymore, will be removed in a further release.
      • tryExtendedGroups

        @Deprecated
        @ScheduledForRemoval
        public PermissionCheckResult tryExtendedGroups​(@NotNull
                                                       @NotNull java.lang.String firstGroup,
                                                       @Nullable
                                                       @Nullable IPermissionGroup permissionGroup,
                                                       @NotNull
                                                       @NotNull java.lang.String group,
                                                       @NotNull
                                                       @NotNull Permission permission,
                                                       int layer)
        Deprecated.
        has no use internally anymore, will be removed in a further release.
      • getAllPermissions

        @NotNull
        public @NotNull java.util.Collection<Permission> getAllPermissions​(@NotNull
                                                                           @NotNull IPermissible permissible)
        Description copied from interface: IPermissionManagement
        Gets all permission of the specified permissible
        Specified by:
        getAllPermissions in interface IPermissionManagement
        Parameters:
        permissible - the permissible to get the permission of.
        Returns:
        all permissions of the permissible
      • getAllPermissions

        @NotNull
        public @NotNull java.util.Collection<Permission> getAllPermissions​(@NotNull
                                                                           @NotNull IPermissible permissible,
                                                                           java.lang.String group)
        Description copied from interface: IPermissionManagement
        Gets all permission of the specified permissible on the given group.
        Specified by:
        getAllPermissions in interface IPermissionManagement
        Parameters:
        permissible - the permissible to get the permission of.
        group - the group to get the permission on or null if no specific group should be used.
        Returns:
        all permissions of the permissible on the specified group if provided