Interface GlobalPermissionService

All Known Implementing Classes:
GlobalPermissionServiceImpl

public interface GlobalPermissionService
Provides mutable operations for SpacePermissions
Since:
9.2.5
  • Method Details

    • getAllPermissions

      List<GlobalPermission> getAllPermissions()

      Get all global permissions

      Returns:
      list of permissions granted to users and groups in the particular space
      Throws:
      PermissionException - if user doesn't have permission to perform this action
    • getPermissionsGrantedToUser

      List<GlobalPermission> getPermissionsGrantedToUser(User user)

      Get the permissions granted to a user.

      Parameters:
      user - user whose permissions we retrieve
      Returns:
      list of global permissions granted to the user
      Throws:
      NotFoundException - if user not found
      PermissionException - if current user doesn't have permission to perform this action
    • getPermissionsGrantedToGroup

      List<GlobalPermission> getPermissionsGrantedToGroup(String groupName)

      Get the permissions granted to a group.

      Parameters:
      groupName - the group name
      Returns:
      list of global permissions granted to group
      Throws:
      NotFoundException - if user not found
      PermissionException - if current user doesn't have permission to perform this action
    • getPermissionsGrantedToAnonymousUsers

      List<GlobalPermission> getPermissionsGrantedToAnonymousUsers()

      Get the permissions granted to an anonymous users.

      Returns:
      list of global permissions granted to anonymous user
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • getPermissionsGrantedToUnlicensedUsers

      List<GlobalPermission> getPermissionsGrantedToUnlicensedUsers()

      Get the permissions granted to unlicensed users.

      Returns:
      list of global permissions granted to unlicensed users
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • grantPermissionsToGroup

      void grantPermissionsToGroup(String groupName, Set<OperationDescription> permissions)

      Grants global permissions to a group.

      Parameters:
      groupName - the name of the group
      permissions - the permissions being granted
      Throws:
      NotFoundException - if group not found
      PermissionException - if current user doesn't have permission to perform this action
    • grantPermissionsToUser

      void grantPermissionsToUser(User user, Set<OperationDescription> permissions)

      Grants global permissions to a user.

      Parameters:
      user - the user to whom we grant permissions
      permissions - the permissions being granted
      Throws:
      NotFoundException - if user not found
      PermissionException - if current user doesn't have permission to perform this action
    • grantPermissionsToAnonymousUsers

      void grantPermissionsToAnonymousUsers(Set<OperationDescription> permissions)

      Grants global permissions to anonymous users.

      Parameters:
      permissions - the permissions being granted
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • grantPermissionsToUnlicensedUsers

      void grantPermissionsToUnlicensedUsers(Set<OperationDescription> permissions)

      Grants global permissions to unlicensed users.

      Parameters:
      permissions - the permissions being granted
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • revokePermissionsFromGroup

      void revokePermissionsFromGroup(String groupName, Set<OperationDescription> permissions)

      Revoke global permissions from a group.

      Parameters:
      groupName - the name of the group
      permissions - the permissions being revoked
      Throws:
      NotFoundException - if group not found
      PermissionException - if current user doesn't have permission to perform this action
    • revokePermissionsFromUser

      void revokePermissionsFromUser(User user, Set<OperationDescription> permissions)

      Revoke global permissions from a user.

      Parameters:
      user - the user from whom we revoke permissions
      permissions - the permissions being revoked
      Throws:
      NotFoundException - if user not found
      PermissionException - if current user doesn't have permission to perform this action
    • revokePermissionsFromAnonymousUsers

      void revokePermissionsFromAnonymousUsers(Set<OperationDescription> permissions)

      Revoke global permissions from anonymous users.

      Parameters:
      permissions - the permissions being revoked
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • revokePermissionsFromUnlicensedUsers

      void revokePermissionsFromUnlicensedUsers(Set<OperationDescription> permissions)

      Revoke global permissions from unlicensed users.

      Parameters:
      permissions - the permissions being revoked
      Throws:
      PermissionException - if current user doesn't have permission to perform this action
    • setPermissions

      void setPermissions(Set<SpacePermissionsForSubject> permissionsForSubjects)
      Sets global permissions to multiple users/groups.

      Request should contain all permissions that user/group will have. If permission is absent in the request, but was granted before, it will be revoked. If empty list of permissions passed to user/group, then all their existing permissions will be revoked. If user/group not mentioned in the request, their permissions will not be revoked.

      Maximum 40 different users/groups could be passed in the request by default.
      Parameters:
      permissionsForSubjects - a set of operations granted users or groups
      Throws:
      NotFoundException - if user/group not found
      PermissionException - if current user doesn't have permission to perform this action