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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRole(java.lang.String theRole)
Adds a new role to the system.void
deleteRole(java.lang.String theRole, boolean isForce)
Removes a role from the system.java.util.Collection<java.lang.String>
getAllRoles()
Gets the names of all roles in the systemjava.util.Collection<java.lang.String>
getUsersWithRole(java.lang.String theRole)
Gets the list of all users with the given role.
-
-
-
Method Detail
-
addRole
void addRole(java.lang.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(java.lang.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
java.util.Collection<java.lang.String> getAllRoles() throws com.complexible.stardog.security.StardogSecurityException, StardogAuthorizationException
Gets 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
java.util.Collection<java.lang.String> getUsersWithRole(java.lang.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
-
-