public interface GlobalPrivilegeAssignmentService
Modifier and Type | Method and Description |
---|---|
Set<UserDescriptor> |
getAllGrantees(Set<Privilege> privileges)
Return a list of users which have ANY of the specified privileges granted
|
Set<Privilege> |
getAvailablePrivileges()
Returns a list of global privileges that are available for global assignment.
|
Set<Privilege> |
getGrantedPrivileges(UserDescriptor user)
Get the set of privileges which are granted to a user.
|
Set<UserDescriptor> |
getGrantees(Privilege privilege)
Get the set of users who have been granted the specified privilege
|
void |
grantPrivilege(UserDescriptor user,
Privilege privilege)
Directly grant a privilege to a specified user.
|
void |
grantPrivileges(UserDescriptor user,
Set<Privilege> privileges)
Directly grant privileges to a specified user.
|
void |
grantPrivilegesToPrincipals(Set<? extends UserDescriptor> users,
Set<Privilege> privileges)
Directly grant privileges to the specified principals.
|
boolean |
hasPrivilege(UserDescriptor user,
Privilege privilege)
Does the specified user have a certain privilege
|
void |
revokeAllPrivileges(UserDescriptor user)
Revoke all privileges directly given to a user.
|
void |
revokePrivilege(UserDescriptor user,
Privilege privilege)
Revoke a privilege directly given to a user.
|
void |
revokePrivileges(UserDescriptor user,
Set<Privilege> privileges)
Revoke a set of privileges directly given to a user.
|
void |
revokePrivilegesFromPrincipals(Set<? extends UserDescriptor> users,
Set<Privilege> privileges)
Revoke a set of privileges directly given to a user.
|
void |
setPrivileges(UserDescriptor user,
Set<Privilege> privileges)
Set what privileges are directly given to a specified user.
|
void grantPrivilege(UserDescriptor user, Privilege privilege) throws InvalidPrivilegeException, PrincipalNotFoundException, PrivilegeExistsException
user
- the principal to grant a privilege to (Note: in this version of the API, the principal is restricted
to a user and not a group).privilege
- the privilege to grant to the user.InvalidPrivilegeException
- thrown when the privilege specified is not defined.PrincipalNotFoundException
- thrown when the principal specified is not found.PrivilegeExistsException
- thrown when the privilege is already directly granted to the specified
principal.void grantPrivileges(UserDescriptor user, Set<Privilege> privileges) throws PrincipalNotFoundException, PrivilegeExistsException, InvalidPrivilegeException
user
- the principal to grant a privilege to (Note: in this version of the API, the principal is restricted
to a user and not a group).privileges
- the set of privileges to grant to the user.InvalidPrivilegeException
- thrown when the privilege specified is not defined.PrincipalNotFoundException
- thrown when the principal specified is not found.PrivilegeExistsException
- thrown when the privilege is already directly granted to the specified
principal.void grantPrivilegesToPrincipals(Set<? extends UserDescriptor> users, Set<Privilege> privileges) throws InvalidPrivilegeException
users
- The principals to give these privileges to (NOTE: in this version of theAPI this is restricted to
users).privileges
- the set of privileges to grantInvalidPrivilegeException
- thrown when the privilege specified is not defined.void revokePrivilege(UserDescriptor user, Privilege privilege) throws InvalidPrivilegeException, PrincipalNotFoundException, PrivilegeNotFoundException
user
- the user who was given the privilegeprivilege
- the privilege to revoke from the userInvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.PrincipalNotFoundException
- thrown when the principal (user) specified is not foundPrivilegeNotFoundException
- thrown when the privilege specified is not definedvoid revokePrivileges(UserDescriptor user, Set<Privilege> privileges) throws PrincipalNotFoundException, PrivilegeNotFoundException, InvalidPrivilegeException
user
- the user who was given the privilegeprivileges
- the set of privileges to revoke from the userInvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.PrincipalNotFoundException
- thrown when the principal (user) specified is not foundPrivilegeNotFoundException
- thrown when the privilege specified is not definedvoid revokeAllPrivileges(UserDescriptor user) throws PrincipalNotFoundException
user
- the user who was given the privilegePrincipalNotFoundException
- thrown when the principal (user) specified is not foundvoid revokePrivilegesFromPrincipals(Set<? extends UserDescriptor> users, Set<Privilege> privileges) throws PrivilegeNotFoundException, InvalidPrivilegeException
users
- the usersprivileges
- the set of privileges to revoke from the usersInvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.PrincipalNotFoundException
- thrown when the principal (user) specified is not foundPrivilegeNotFoundException
- thrown when the privilege specified is not definedvoid setPrivileges(UserDescriptor user, Set<Privilege> privileges) throws PrincipalNotFoundException, InvalidPrivilegeException
user
- the user who is given the privilegesprivileges
- the set of privileges to revoke from the userInvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.PrincipalNotFoundException
- thrown when the principal (user) specified is not foundSet<Privilege> getGrantedPrivileges(UserDescriptor user) throws PrincipalNotFoundException
user
- the user in questionPrincipalNotFoundException
- thrown when the principal (user) specified is not foundSet<UserDescriptor> getGrantees(Privilege privilege) throws InvalidPrivilegeException
privilege
- the privilege in questionInvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.PrincipalNotFoundException
- thrown when the principal (user) specified is not foundSet<UserDescriptor> getAllGrantees(Set<Privilege> privileges) throws InvalidPrivilegeException
privileges
- the privileges in questionInvalidPrivilegeException
- the privilege specified is not defined on the serverboolean hasPrivilege(UserDescriptor user, Privilege privilege) throws InvalidPrivilegeException, PrincipalNotFoundException
user
- the user in questionprivilege
- the privilege in questionInvalidPrivilegeException
- The privilege specified is not defined on the serverPrincipalNotFoundException
- The user specified is not defined on the serverCopyright (c) 2017, SAS Institute Inc., Cary, NC, USA