Interface RoleManager


public interface RoleManager
API for managing user roles in Stardog.
Since:
0.9
Version:
0.9
Author:
Blazej Bulka
  • 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 role
      com.complexible.stardog.security.ResourceExistsException - if there is already a role with such a name
      com.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 removed
      isForce - whether to remove the role from the users using it
      Throws:
      com.complexible.stardog.security.ResourceNotFoundException - there is no such role in the system
      com.complexible.stardog.security.ResourceInUseException - the role is assigned to one or more users
      StardogAuthorizationException - the current user does not have a permission to remove the role
      com.complexible.stardog.security.StardogSecurityException - if the operation cannot be completed for any other reason
    • getAllRoles

      Collection<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 roles
      com.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 operation
      com.complexible.stardog.security.ResourceNotFoundException - if there is no such role in the system
      com.complexible.stardog.security.StardogSecurityException - if the operation cannot be completed for any other reason