Package com.complexible.stardog.security
Interface RoleManager
public interface RoleManager
API for managing user roles in Stardog.
- Since:
- 0.9
- Version:
- 0.9
- Author:
- Blazej Bulka
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new role to the system.voiddeleteRole(String theRole, boolean isForce) Removes a role from the system.Gets the names of all roles in the systemgetUsersWithRole(String theRole) Gets the list of all users with the given role.
-
Method Details
-
addRole
void addRole(String theRole) throws com.complexible.stardog.security.StardogSecurityException, StardogAuthorizationException, com.complexible.stardog.security.ResourceExistsException Adds a new role to the system.- Parameters:
theRole- the name of the new role- Throws:
StardogAuthorizationException- if the current user does not have a permission to add the new rolecom.complexible.stardog.security.ResourceExistsException- if there is already a role with such a namecom.complexible.stardog.security.StardogSecurityException- if the operation cannot be completed for any other reason
-
deleteRole
void deleteRole(String theRole, boolean isForce) throws com.complexible.stardog.security.StardogSecurityException, com.complexible.stardog.security.ResourceNotFoundException, com.complexible.stardog.security.ResourceInUseException, StardogAuthorizationException Removes a role from the system.- Parameters:
theRole- the name of the role to be removedisForce- whether to remove the role from the users using it- Throws:
com.complexible.stardog.security.ResourceNotFoundException- there is no such role in the systemcom.complexible.stardog.security.ResourceInUseException- the role is assigned to one or more usersStardogAuthorizationException- the current user does not have a permission to remove the rolecom.complexible.stardog.security.StardogSecurityException- if the operation cannot be completed for any other reason
-
getAllRoles
Collection<String> getAllRoles() throws com.complexible.stardog.security.StardogSecurityException, StardogAuthorizationExceptionGets the names of all roles in the system- Returns:
- collection of all role names
- Throws:
StardogAuthorizationException- if the current user does not have permission to list all the rolescom.complexible.stardog.security.StardogSecurityException- if the operation cannot be completed for any other reason
-
getUsersWithRole
Collection<String> getUsersWithRole(String theRole) throws com.complexible.stardog.security.StardogSecurityException, StardogAuthorizationException, com.complexible.stardog.security.ResourceNotFoundException Gets the list of all users with the given role.- Parameters:
theRole- the name of the role- Returns:
- collection of all users that have that role
- Throws:
StardogAuthorizationException- if the current user does not have necessary permissions for this operationcom.complexible.stardog.security.ResourceNotFoundException- if there is no such role in the systemcom.complexible.stardog.security.StardogSecurityException- if the operation cannot be completed for any other reason
-