com.clarkparsia.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
 void addRole(String theRole)
          Adds a new role to the system.
 void deleteRole(String theRole)
          Deprecated. use deleteRole(String, boolean). Scheduled for removal in 1.2.
 void deleteRole(String theRole, boolean isForce)
          Removes a role from the system.
 Collection<String> getAllRoles()
          Gets the names of all roles in the system
 Collection<String> getUsersWithRole(String theRole)
          Gets the list of all users with the given role.
 

Method Detail

addRole

void addRole(String theRole)
             throws com.clarkparsia.stardog.security.StardogSecurityException,
                    com.clarkparsia.stardog.security.StardogAuthorizationException,
                    com.clarkparsia.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
ResourceExistsException - if there is already a role with such a name
StardogSecurityException - if the operation cannot be completed for any other reason

deleteRole

@Deprecated
void deleteRole(String theRole)
                throws com.clarkparsia.stardog.security.StardogSecurityException,
                       com.clarkparsia.stardog.security.ResourceNotFoundException,
                       com.clarkparsia.stardog.security.ResourceInUseException,
                       com.clarkparsia.stardog.security.StardogAuthorizationException
Deprecated. use deleteRole(String, boolean). Scheduled for removal in 1.2.

Removes a role from the system. The role must not be assigned to any of the users.

Parameters:
theRole - the name of the role to be removed
Throws:
ResourceNotFoundException - there is no such role in the system
ResourceInUseException - the role is assigned to one or more users
StardogAuthorizationException - the current user does not have a permission to remove the role
StardogSecurityException - if the operation cannot be completed for any other reason

deleteRole

void deleteRole(String theRole,
                boolean isForce)
                throws com.clarkparsia.stardog.security.StardogSecurityException,
                       com.clarkparsia.stardog.security.ResourceNotFoundException,
                       com.clarkparsia.stardog.security.ResourceInUseException,
                       com.clarkparsia.stardog.security.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:
ResourceNotFoundException - there is no such role in the system
ResourceInUseException - the role is assigned to one or more users
StardogAuthorizationException - the current user does not have a permission to remove the role
StardogSecurityException - if the operation cannot be completed for any other reason

getAllRoles

Collection<String> getAllRoles()
                               throws com.clarkparsia.stardog.security.StardogSecurityException,
                                      com.clarkparsia.stardog.security.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
StardogSecurityException - if the operation cannot be completed for any other reason

getUsersWithRole

Collection<String> getUsersWithRole(String theRole)
                                    throws com.clarkparsia.stardog.security.StardogSecurityException,
                                           com.clarkparsia.stardog.security.StardogAuthorizationException,
                                           com.clarkparsia.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
ResourceNotFoundException - if there is no such role in the system
StardogSecurityException - if the operation cannot be completed for any other reason


Copyright © 2010-2013 Clark & Parsia. All Rights Reserved.