com.clarkparsia.stardog.security
Interface PermissionManager


public interface PermissionManager

API for managing permissions in Stardog

Since:
0.9
Version:
0.9
Author:
Blazej Bulka

Method Summary
 void addRolePerm(String theRolename, ActionType theActionType, SecurityResourceType theResourceType, String theResourceName)
          Grants a permission to a role.
 void addUserPerm(String theUsername, ActionType theActionType, SecurityResourceType theResourceType, String theResourceName)
          Grants a permission to a user.
 void deleteRolePerm(String theRolename, ActionType theActionType, SecurityResourceType theResourceType, String theResourceName)
          Revokes a permission from a role.
 void deleteUserPerm(String theUsername, ActionType theActionType, SecurityResourceType theResourceType, String theResourceName)
          Revokes a permission from a user.
 Collection<String> getEffectiveUserPerms(String theUsername)
          Return the effective permissions, explicit and inferred, for the specified user
 Collection<String> getRolePerms(String theRole)
          Return the permissions associated with the specified role
 Collection<String> getUserPerms(String theUsername)
          Gets the current user permissions (explicit only)
 

Method Detail

addRolePerm

void addRolePerm(String theRolename,
                 ActionType theActionType,
                 SecurityResourceType theResourceType,
                 String theResourceName)
                 throws com.clarkparsia.stardog.security.StardogSecurityException,
                        com.clarkparsia.stardog.security.ResourceNotFoundException,
                        com.clarkparsia.stardog.security.ResourceExistsException,
                        com.clarkparsia.stardog.security.StardogAuthorizationException
Grants a permission to a role.

Parameters:
theRolename - the name of the role to which the permission should be added
theActionType - the name of the action that should be permitted
theResourceType - the type of the resource to which this permission will be applicable
theResourceName - the name of a specific resource to which this permission should be applicable (use SecurityUtil.ALL_RESOURCE for permissions that should apply to all resources of given type)
Throws:
ResourceNotFoundException - if the resource referenced in the operation does not exist
ResourceExistsException - if there is already such a permission for this role
StardogAuthorizationException - if the current user is not authorized to grant the permission
StardogSecurityException - if the operation should fail for any other reason

deleteRolePerm

void deleteRolePerm(String theRolename,
                    ActionType theActionType,
                    SecurityResourceType theResourceType,
                    String theResourceName)
                    throws com.clarkparsia.stardog.security.StardogSecurityException,
                           com.clarkparsia.stardog.security.ResourceNotFoundException,
                           com.clarkparsia.stardog.security.StardogAuthorizationException
Revokes a permission from a role.

Parameters:
theRolename - the name of the role from which the permission should be removed
theActionType - the name of the action that should no longer be permitted
theResourceType - the type of the resource to which this permission was applicable
theResourceName - the name of a specific resource to which this permission was applicable (use SecurityUtil#ALL_RESOURCE for permissions that apply to all resources of given type)
Throws:
ResourceNotFoundException - if the resource referenced in the operation does not exist or the role does not have the permission
StardogAuthorizationException - if the current user is not authorized to revoke the permission
StardogSecurityException - if the operation should fail for any other reason

addUserPerm

void addUserPerm(String theUsername,
                 ActionType theActionType,
                 SecurityResourceType theResourceType,
                 String theResourceName)
                 throws com.clarkparsia.stardog.security.StardogSecurityException,
                        com.clarkparsia.stardog.security.ResourceNotFoundException,
                        com.clarkparsia.stardog.security.ResourceExistsException,
                        com.clarkparsia.stardog.security.StardogAuthorizationException
Grants a permission to a user.

Parameters:
theUsername - the name of the user to whom the permission should be added
theActionType - the name of the action that should be permitted
theResourceType - the type of the resource to which this permission will be applicable
theResourceName - the name of a specific resource to which this permission should be applicable (use SecurityUtil.ALL_RESOURCE for permissions that should apply to all resources of given type)
Throws:
ResourceNotFoundException - if the resource referenced in the operation does not exist
ResourceExistsException - if there is already such a permission for this user
StardogAuthorizationException - if the current user is not authorized to grant the permission
StardogSecurityException - if the operation should fail for any other reason

deleteUserPerm

void deleteUserPerm(String theUsername,
                    ActionType theActionType,
                    SecurityResourceType theResourceType,
                    String theResourceName)
                    throws com.clarkparsia.stardog.security.StardogSecurityException,
                           com.clarkparsia.stardog.security.ResourceNotFoundException,
                           com.clarkparsia.stardog.security.StardogAuthorizationException
Revokes a permission from a user.

Parameters:
theUsername - the name of the user from whom the permission should be revoked
theActionType - the name of the action that no longer should be permitted
theResourceType - the type of the resource to which this permission was applicable
theResourceName - the name of a specific resource to which this permission was applicable (use SecurityUtil#ALL_RESOURCE for permissions that apply to all resources of given type)
Throws:
ResourceNotFoundException - if the resource referenced in the operation does not exist (or the user does not have the permission to be revoked)
StardogAuthorizationException - if the current user is not authorized to revoke the permission
StardogSecurityException - if the operation should fail for any other reason

getUserPerms

Collection<String> getUserPerms(String theUsername)
                                throws com.clarkparsia.stardog.security.StardogSecurityException,
                                       com.clarkparsia.stardog.security.ResourceNotFoundException,
                                       com.clarkparsia.stardog.security.StardogAuthorizationException
Gets the current user permissions (explicit only)

Parameters:
theUsername - the user name whose permissions should be retrieved
Returns:
a collection of string representations of permissions
Throws:
ResourceNotFoundException - if there is no user with the specified name
StardogAuthorizationException - if the current user does not have a permission to retrieve the permission information for the specified user
StardogSecurityException - if the operation should fail for any other reason

getEffectiveUserPerms

Collection<String> getEffectiveUserPerms(String theUsername)
                                         throws com.clarkparsia.stardog.security.StardogSecurityException,
                                                com.clarkparsia.stardog.security.ResourceNotFoundException,
                                                com.clarkparsia.stardog.security.StardogAuthorizationException
Return the effective permissions, explicit and inferred, for the specified user

Parameters:
theUsername - the user
Returns:
the effective permissions of the user
Throws:
StardogSecurityException - if the operation should fail for any other reason
ResourceNotFoundException - if the user is not found
StardogAuthorizationException - if the current user cannot perform this operation

getRolePerms

Collection<String> getRolePerms(String theRole)
                                throws com.clarkparsia.stardog.security.StardogSecurityException,
                                       com.clarkparsia.stardog.security.ResourceNotFoundException,
                                       com.clarkparsia.stardog.security.StardogAuthorizationException
Return the permissions associated with the specified role

Parameters:
theRole - the name of the role
Returns:
the permissions for the role
Throws:
StardogSecurityException - if the operation should fail for any other reason
ResourceNotFoundException - if the role is not found
StardogAuthorizationException - if the current user cannot perform the operation


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