Class PermissionSet


  • public class PermissionSet
    extends Object
    Represents an utility class that organizes and manages global and project permissions.

    Able to distinguish the following cases:

    • global permissions (ones that are never applied to a project)
    • project-related permissions in a project scope
    • project-related permissions in a global scope
    The client can add permissions directly (project and global ones), or by passing role entries; and check the result permissions of any type.
    Author:
    Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
    • Constructor Detail

      • PermissionSet

        public PermissionSet()
    • Method Detail

      • addRoleEntry

        public void addRoleEntry​(@NotNull
                                 RoleScope scope,
                                 @NotNull
                                 Role role)
      • addGlobalPermissions

        public void addGlobalPermissions​(@NotNull
                                         Permissions permissions)
      • addProjectPermissions

        public void addProjectPermissions​(@NotNull
                                          String projectId,
                                          @NotNull
                                          Permissions permissions)
      • getProjects

        @NotNull
        public Set<String> getProjects()
      • hasNonProjectPermissions

        public boolean hasNonProjectPermissions()
      • hasProjectPermissionsGrantedGlobally

        public boolean hasProjectPermissionsGrantedGlobally()