|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GlobalPrivilegeAssignmentService
The GlobalPrivilegeAssignmentService 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
Method Summary | |
---|---|
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. |
Method Detail |
---|
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 grant
InvalidPrivilegeException
- 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 user
InvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.
PrincipalNotFoundException
- thrown when the principal (user) specified is not found
PrivilegeNotFoundException
- 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 user
InvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.
PrincipalNotFoundException
- thrown when the principal (user) specified is not found
PrivilegeNotFoundException
- thrown when the privilege specified is not definedvoid revokeAllPrivileges(UserDescriptor user) throws PrincipalNotFoundException
user
- the user who was given the privilege
PrincipalNotFoundException
- 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 users
InvalidPrivilegeException
- thrown when the privilege specified is not granted to the principal.
PrincipalNotFoundException
- thrown when the principal (user) specified is not found
PrivilegeNotFoundException
- 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 user
InvalidPrivilegeException
- 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 question
PrincipalNotFoundException
- thrown when the principal (user) specified is not foundSet<UserDescriptor> getGrantees(Privilege privilege) throws InvalidPrivilegeException
privilege
- the privilege in question
InvalidPrivilegeException
- 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 question
InvalidPrivilegeException
- 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 question
InvalidPrivilegeException
- The privilege specified is not defined on the server
PrincipalNotFoundException
- The user specified is not defined on the serverSet<Privilege> getAvailablePrivileges()
Privilege
objects that are available for global assignment.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |