Class RBACManager
java.lang.Object
it.uniroma2.art.semanticturkey.rbac.RBACManager
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCapability
(Project project, String role, String capability) static void
addSystemRole
(String roleName, File roleFile) static void
createRole
(Project project, String roleName) static void
deleteRole
(Project project, String roleName) static RBACProcessor
getRBACProcessor
(Project project, String role) Returns the RBACProcessor for the given role in the given project.static Role
Returns the role with the given name,null
if no role is found with the given name.static Collection<String>
getRoleCapabilities
(Project project, String role) Returns the capabilities of the given role.static File
getRoleFile
(Project project, String role) static Collection<Role>
Returns the roles defined at system level and in the given projectstatic File
getRolesDir
(Project project) static void
static void
loadRBACProcessor
(Project project) Loads the roles and the rbac processor for the given project.static void
removeCapability
(Project project, String role, String capability) static boolean
roleExists
(Project project, String roleName) static void
setCapabilities
(Project project, String role, Collection<String> capabilities) static void
unloadRBACProcessor
(String projectName)
-
Constructor Details
-
RBACManager
public RBACManager()
-
-
Method Details
-
initRoles
- Throws:
ProjectAccessException
-
loadRBACProcessor
Loads the roles and the rbac processor for the given project.- Parameters:
project
-null
meansSYSTEM
- Throws:
alice.tuprolog.InvalidTheoryException
TheoryNotFoundException
RBACException
-
unloadRBACProcessor
-
getRBACProcessor
Returns the RBACProcessor for the given role in the given project. If project is null, searches the role at system level.- Parameters:
project
-role
-- Returns:
-
getRoles
Returns the roles defined at system level and in the given project- Parameters:
project
-- Returns:
-
getRole
Returns the role with the given name,null
if no role is found with the given name. This method first searches for the role in the given project, then if no role is found, searches at system level.- Parameters:
project
-roleName
-- Returns:
-
roleExists
-
createRole
- Parameters:
project
-roleName
-- Throws:
RoleCreationException
-
addSystemRole
- Parameters:
roleName
-roleFile
-- Throws:
RoleCreationException
-
deleteRole
-
getRoleCapabilities
public static Collection<String> getRoleCapabilities(Project project, String role) throws RBACException Returns the capabilities of the given role. This method looks for the role first at project level, then at system level.- Parameters:
project
-role
-- Returns:
- Throws:
RBACException
-
setCapabilities
public static void setCapabilities(Project project, String role, Collection<String> capabilities) throws RBACException - Throws:
RBACException
-
addCapability
public static void addCapability(Project project, String role, String capability) throws RBACException - Throws:
RBACException
-
removeCapability
public static void removeCapability(Project project, String role, String capability) throws RBACException - Throws:
RBACException
-
getRolesDir
-
getRoleFile
-