Package com.sas.lsaf.security.privilege

## Interface GlobalPrivilegeService

-     public interface GlobalPrivilegeService

  The global privilege service provides methods to manage the assignment of global privileges to users. Global privileges are system level privileges that are not associated with contexts. These can be directly granted to users in the system. since 1.2
  See Also:
    `LsafClient.getGlobalPrivilegeService()`, `ServiceManager.getGlobalPrivilegeService()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Set<UserDescriptor>` | `getAllGrantees​(java.util.Set<java.lang.String> globalPrivilegeIds)` | Gets the set of users who have been granted the specified set of global privileges.
    `java.util.Set<GlobalPrivilege>` | `getAvailablePrivileges()` | Returns a list of global privileges that are available for assignment.
    `java.util.Set<GlobalPrivilege>` | `getGrantedPrivileges​(java.lang.String userId)` | Gets the set of global privileges that are granted to a user.
    `java.util.Set<UserDescriptor>` | `getGrantees​(java.lang.String globalPrivilegeId)` | Gets the set of users who have been granted the specified global privilege.
    `void` | `grantPrivilege​(java.lang.String userId, java.lang.String globalPrivilegeId)` | Grants a global privilege to the specified user.
    `void` | `grantPrivileges​(java.lang.String userId, java.util.Set<java.lang.String> globalPrivilegeIds)` | Grants the global privileges to the specified user.
    `void` | `grantPrivilegesToUsers​(java.util.Set<java.lang.String> userIds, java.util.Set<java.lang.String> globalPrivilegeIds)` | Grants the global privileges to the specified set of users.
    `boolean` | `hasPrivilege​(java.lang.String userId, java.lang.String globalPrivilegeId)` | Indicates whether the specified user has the specified global privilege.
    `void` | `revokeAllPrivileges​(java.lang.String userId)` | Revokes all global privileges from the specified user.
    `void` | `revokePrivilege​(java.lang.String userId, java.lang.String globalPrivilegeId)` | Revokes a global privilege from the specified user.
    `void` | `revokePrivileges​(java.lang.String userId, java.util.Set<java.lang.String> globalPrivilegeIds)` | Revokes a set of global privileges from the set of users.
    `void` | `revokePrivilegesFromUsers​(java.util.Set<java.lang.String> userIds, java.util.Set<java.lang.String> globalPrivilegeIds)` | Revokes a set of global privileges from a set of users.
    `void` | `setPrivileges​(java.lang.String userId, java.util.Set<java.lang.String> globalPrivilegeIds)` | Sets the global privileges that are granted to the specified user.

- - ### Method Detail

    - #### grantPrivilege

          void grantPrivilege​(java.lang.String userId,
                              java.lang.String globalPrivilegeId)
                       throws PrincipalNotFoundException,
                              PrivilegeNotFoundException

      Grants a global privilege to the specified user.
      Parameters:
        `userId` - the user to grant the privilege to.
        `globalPrivilegeId` - the global privilege to grant to the user.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.
        `PrivilegeNotFoundException` - thrown when the privilege specified is not defined.

    - #### grantPrivileges

          void grantPrivileges​(java.lang.String userId,
                               java.util.Set<java.lang.String> globalPrivilegeIds)
                        throws PrincipalNotFoundException,
                               PrivilegeNotFoundException

      Grants the global privileges to the specified user.
      Parameters:
        `userId` - the user to grant the privileges to.
        `globalPrivilegeIds` - the set of global privileges to grant to the user.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.
        `PrivilegeNotFoundException` - thrown when the privilege specified is not defined.

    - #### grantPrivilegesToUsers

          void grantPrivilegesToUsers​(java.util.Set<java.lang.String> userIds,
                                      java.util.Set<java.lang.String> globalPrivilegeIds)
                               throws PrincipalNotFoundException,
                                      PrivilegeNotFoundException

      Grants the global privileges to the specified set of users.
      Parameters:
        `userIds` - the users to grant the privileges to.
        `globalPrivilegeIds` - the set of global privileges to grant.
      Throws:
        `PrincipalNotFoundException` - thrown when a user specified is not found.
        `PrivilegeNotFoundException` - thrown when a privilege specified is not defined.

    - #### revokePrivilege

          void revokePrivilege​(java.lang.String userId,
                               java.lang.String globalPrivilegeId)
                        throws PrincipalNotFoundException,
                               PrivilegeNotFoundException

      Revokes a global privilege from the specified user.
      Parameters:
        `userId` - the user to revoke the privilege from.
        `globalPrivilegeId` - the global privilege to revoke from the user.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.
        `PrivilegeNotFoundException` - thrown when the privilege specified is not defined.

    - #### revokePrivileges

          void revokePrivileges​(java.lang.String userId,
                                java.util.Set<java.lang.String> globalPrivilegeIds)
                         throws PrincipalNotFoundException,
                                PrivilegeNotFoundException

      Revokes a set of global privileges from the set of users.
      Parameters:
        `userId` - the user to revoke the privilege from.
        `globalPrivilegeIds` - the set of global privileges to revoke from the user.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.
        `PrivilegeNotFoundException` - thrown when a privilege specified is not defined.

    - #### revokePrivilegesFromUsers

          void revokePrivilegesFromUsers​(java.util.Set<java.lang.String> userIds,
                                         java.util.Set<java.lang.String> globalPrivilegeIds)
                                  throws PrincipalNotFoundException,
                                         PrivilegeNotFoundException

      Revokes a set of global privileges from a set of users.
      Parameters:
        `userIds` - the users to grant the privileges to.
        `globalPrivilegeIds` - the set of global privileges to revoke from the user.
      Throws:
        `PrincipalNotFoundException` - thrown when a user specified is not found.
        `PrivilegeNotFoundException` - thrown when a privilege specified is not defined.

    - #### revokeAllPrivileges

          void revokeAllPrivileges​(java.lang.String userId)
                            throws PrincipalNotFoundException

      Revokes all global privileges from the specified user.
      Parameters:
        `userId` - the user to revoke the privileges from.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.

    - #### setPrivileges

          void setPrivileges​(java.lang.String userId,
                             java.util.Set<java.lang.String> globalPrivilegeIds)
                      throws PrincipalNotFoundException,
                             PrivilegeNotFoundException

      Sets the global privileges that are granted to the specified user.
      Parameters:
        `userId` - the user to set global privileges on.
        `globalPrivilegeIds` - the set of global privileges to assign to the user.
      Throws:
        `PrincipalNotFoundException` - thrown when a user specified is not found.
        `PrivilegeNotFoundException` - thrown when the privilege specified is not defined.

    - #### getGrantedPrivileges

          java.util.Set<GlobalPrivilege> getGrantedPrivileges​(java.lang.String userId)
                                                       throws PrincipalNotFoundException

      Gets the set of global privileges that are granted to a user.
      Parameters:
        `userId` - the user to retrieve granted global privileges.
      Returns:
        The set of privileges granted to the user.
      Throws:
        `PrincipalNotFoundException` - thrown when the user specified is not found.

    - #### getGrantees

          java.util.Set<UserDescriptor> getGrantees​(java.lang.String globalPrivilegeId)
                                             throws PrivilegeNotFoundException

      Gets the set of users who have been granted the specified global privilege.
      Parameters:
        `globalPrivilegeId` - the global privilege in question.
      Returns:
        The set of users who are granted the privilege.
      Throws:
        `PrivilegeNotFoundException` - thrown when the privilege specified is not defined.

    - #### getAllGrantees

          java.util.Set<UserDescriptor> getAllGrantees​(java.util.Set<java.lang.String> globalPrivilegeIds)
                                                throws PrivilegeNotFoundException

      Gets the set of users who have been granted the specified set of global privileges.
      Parameters:
        `globalPrivilegeIds` - the global privileges in question.
      Returns:
        The set of users who are granted the privileges.
      Throws:
        `PrivilegeNotFoundException` - thrown when a privilege specified is not defined.

    - #### hasPrivilege

          boolean hasPrivilege​(java.lang.String userId,
                               java.lang.String globalPrivilegeId)

      Indicates whether the specified user has the specified global privilege.
      Parameters:
        `userId` - the user to check.
        `globalPrivilegeId` - the global privilege in question.
      Returns:
        A Boolean value that indicates whether the user has the privilege.

    - #### getAvailablePrivileges

          java.util.Set<GlobalPrivilege> getAvailablePrivileges()

      Returns a list of global privileges that are available for assignment.
      Returns:
        List of `GlobalPrivilege` objects that are available for assignment.