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:
-
Method Summary
Modifier and TypeMethodDescriptiongetAllGrantees(Set<String> globalPrivilegeIds) Gets the set of users who have been granted the specified set of global privileges.Returns a list of global privileges that are available for assignment.getGrantedPrivileges(String userId) Gets the set of global privileges that are granted to a user.getGrantees(String globalPrivilegeId) Gets the set of users who have been granted the specified global privilege.voidgrantPrivilege(String userId, String globalPrivilegeId) Grants a global privilege to the specified user.voidgrantPrivileges(String userId, Set<String> globalPrivilegeIds) Grants the global privileges to the specified user.voidgrantPrivilegesToUsers(Set<String> userIds, Set<String> globalPrivilegeIds) Grants the global privileges to the specified set of users.booleanhasPrivilege(String userId, String globalPrivilegeId) Indicates whether the specified user has the specified global privilege.voidrevokeAllPrivileges(String userId) Revokes all global privileges from the specified user.voidrevokePrivilege(String userId, String globalPrivilegeId) Revokes a global privilege from the specified user.voidrevokePrivileges(String userId, Set<String> globalPrivilegeIds) Revokes a set of global privileges from the set of users.voidrevokePrivilegesFromUsers(Set<String> userIds, Set<String> globalPrivilegeIds) Revokes a set of global privileges from a set of users.voidsetPrivileges(String userId, Set<String> globalPrivilegeIds) Sets the global privileges that are granted to the specified user.
-
Method Details
-
grantPrivilege
void grantPrivilege(String userId, 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(String userId, Set<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(Set<String> userIds, Set<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(String userId, 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(String userId, Set<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(Set<String> userIds, Set<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
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(String userId, Set<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
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
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
Set<UserDescriptor> getAllGrantees(Set<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
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
Set<GlobalPrivilege> getAvailablePrivileges()Returns a list of global privileges that are available for assignment.- Returns:
- List of
GlobalPrivilegeobjects that are available for assignment.
-