Class LdapRbacManager
- java.lang.Object
-
- org.apache.archiva.redback.rbac.AbstractRBACManager
-
- org.apache.archiva.redback.rbac.ldap.LdapRbacManager
-
- All Implemented Interfaces:
RBACManager,RBACManagerListener
@Service("rbacManager#ldap") public class LdapRbacManager extends AbstractRBACManager implements RBACManager, RBACManagerListenerLdapRbacManager will read datas from ldap for mapping groups to role. Write operations will delegate to cached implementation.- Author:
- Olivier Lamy
-
-
Constructor Summary
Constructors Constructor Description LdapRbacManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildRole(Role role, Role childRole)Adds a child to a role.voidaddListener(RBACManagerListener listener)protected booleancheckIfLdapRole(String roleName)protected voidcloseContext(DirContext context)protected voidcloseLdapConnection(LdapConnection ldapConnection)OperationcreateOperation(String name)PermissioncreatePermission(String name)Creates an implementation specificPermission, or return an existingPermission, depending on the providednameparameter.PermissioncreatePermission(String name, String operationName, String resourceIdentifier)ResourcecreateResource(String identifier)RolecreateRole(String id, String name)Creates a new role with the given id and role name.UserAssignmentcreateUserAssignment(String username)Creates an implementation specificUserAssignment, or return an existingUserAssignment, depending on the providedidentifierparameter.voideraseDatabase()List<Role>getAllAssignableRoles()Returns a list of all assignable rolesList<? extends Operation>getAllOperations()List<? extends Permission>getAllPermissions()List<? extends Resource>getAllResources()List<Role>getAllRoles()Returns all roles defined in the datastore.List<UserAssignment>getAllUserAssignments()Returns all user assignments definedCollection<Role>getAssignedRoles(String username)returns the active roles for a given principal NOTE: roles that are returned might have have roles themselves, if you just want all permissions then useAbstractRBACManager.getAssignedPermissions(String principal)Collection<Role>getAssignedRoles(UserAssignment userAssignment)returns only the roles that are assigned, not the roles that might be child roles of the assigned roles.Map<String,? extends Role>getChildRoleIds(Role role)Returns all the child roles of a given role as (role id, role) pairs.Map<String,? extends Role>getChildRoleNames(Role role)Returns all the child roles of a given role as (name, role) pairs.StringgetDescriptionKey()Set<? extends Role>getEffectiveRoles(Role role)Returns all effective roles.ResourcegetGlobalResource()Returns the global resource objectLdapRoleMappergetLdapRoleMapper()OperationgetOperation(String operationName)Map<String,? extends Role>getParentRoleIds(Role role)Returns all the parent roles of a given role as map of (id, role) elements.Map<String,? extends Role>getParentRoleNames(Role role)Returns all the parent roles of a given role as map of (name, role) elements.PermissiongetPermission(String permissionName)RBACManagergetRbacImpl()protected List<String>getRealRoles()ResourcegetResource(String resourceIdentifier)RolegetRole(String roleName)Returns the role identified by the given nameRolegetRoleById(String id)Returns the role identified by the given IDMap<String,? extends Role>getRoles(Collection<String> roleNames)Returns the role instances for the given role names.Collection<Role>getUnassignedRoles(String username)Get a list of all assignable roles that are currently not assigned to the specific user.UserAssignmentgetUserAssignment(String username)List<? extends UserAssignment>getUserAssignmentsForRoles(Collection<String> roleIds)Returns the assignments for the given rolesvoidinitialize()consumer of user manager can use it to reload various configuration with the configurable implementation is possible to change dynamically the real implementation used.booleanisFinalImplementation()booleanisReadOnly()Is the RBACManager read only? if so then create and modify actions are to be disabledbooleanisWritableLdap()booleanoperationExists(String name)booleanoperationExists(Operation operation)booleanpermissionExists(String name)Tests for the existence of a permission.booleanpermissionExists(Permission permission)voidrbacInit(boolean freshdb)voidrbacPermissionRemoved(Permission permission)voidrbacPermissionSaved(Permission permission)voidrbacRoleRemoved(Role role)voidrbacRoleSaved(Role role)voidrbacUserAssignmentRemoved(UserAssignment userAssignment)voidrbacUserAssignmentSaved(UserAssignment userAssignment)voidremoveListener(RBACManagerListener listener)voidremoveOperation(String operationName)voidremoveOperation(Operation operation)voidremovePermission(String permissionName)voidremovePermission(Permission permission)voidremoveResource(String resourceIdentifier)voidremoveResource(Resource resource)voidremoveRole(String roleName)Removes the role with the given name from the datastore.voidremoveRole(Role role)Removes the given role from the datastore.voidremoveUserAssignment(String username)Method removeAssignmentvoidremoveUserAssignment(UserAssignment userAssignment)Method removeAssignmentbooleanresourceExists(String identifier)booleanresourceExists(Resource resource)booleanroleExists(String name)Tests for the existence of a Role.booleanroleExists(Role role)Returns true, if the given role exists.booleanroleExistsById(String id)Returnstrue, if a role with the given id exists.OperationsaveOperation(Operation operation)Save the new or existing operation to the store.PermissionsavePermission(Permission permission)ResourcesaveResource(Resource resource)RolesaveRole(Role role)Persists the given role to the backend datastore.voidsaveRoles(Collection<Role> roles)Persists all of the given roles to the backend datastore.UserAssignmentsaveUserAssignment(UserAssignment userAssignment)Method saveUserAssignmentvoidsetLdapRoleMapper(LdapRoleMapper ldapRoleMapper)voidsetRbacImpl(RBACManager rbacImpl)voidsetWritableLdap(boolean writableLdap)booleanuserAssignmentExists(String principal)booleanuserAssignmentExists(UserAssignment assignment)-
Methods inherited from class org.apache.archiva.redback.rbac.AbstractRBACManager
createRole, fireRbacInit, fireRbacPermissionRemoved, fireRbacPermissionSaved, fireRbacRoleRemoved, fireRbacRoleSaved, fireRbacUserAssignmentRemoved, fireRbacUserAssignmentSaved, getAssignedPermissionMap, getAssignedPermissions, getEffectivelyAssignedRoles, getEffectivelyAssignedRoles, getEffectivelyUnassignedRoles, removeRoleById
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.archiva.redback.rbac.RBACManager
createRole, getAssignedPermissionMap, getAssignedPermissions, getEffectivelyAssignedRoles, getEffectivelyUnassignedRoles, removeRoleById
-
-
-
-
Constructor Detail
-
LdapRbacManager
public LdapRbacManager()
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
Description copied from interface:RBACManagerconsumer of user manager can use it to reload various configuration with the configurable implementation is possible to change dynamically the real implementation used.- Specified by:
initializein interfaceRBACManager- Overrides:
initializein classAbstractRBACManager
-
addChildRole
public void addChildRole(Role role, Role childRole) throws RbacObjectInvalidException, RbacManagerException
Description copied from interface:RBACManagerAdds a child to a role.- Specified by:
addChildRolein interfaceRBACManager- Overrides:
addChildRolein classAbstractRBACManager- Parameters:
role- the parent rolechildRole- the child role, that is added to the parent role- Throws:
RbacObjectInvalidException- if one of the role objects was not validRbacManagerException- if the access to the backend datastore failed
-
addListener
public void addListener(RBACManagerListener listener)
- Specified by:
addListenerin interfaceRBACManager- Overrides:
addListenerin classAbstractRBACManager
-
createOperation
public Operation createOperation(String name) throws RbacManagerException
Description copied from interface:RBACManagerCreates an implementation specificOperation, or return an existingOperation, depending on the providednameparameter. Note: Be sure to useRBACManager.saveOperation(Operation)in order to persist any changes to the Role.- Specified by:
createOperationin interfaceRBACManager- Parameters:
name- the name.- Returns:
- the new Operation.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
createPermission
public Permission createPermission(String name) throws RbacManagerException
Description copied from interface:RBACManagerCreates an implementation specificPermission, or return an existingPermission, depending on the providednameparameter. Note: Be sure to useRBACManager.savePermission(Permission)in order to persist any changes to the Role.- Specified by:
createPermissionin interfaceRBACManager- Parameters:
name- the name.- Returns:
- the new Permission.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
createPermission
public Permission createPermission(String name, String operationName, String resourceIdentifier) throws RbacManagerException
Description copied from interface:RBACManagerCreates an implementation specificPermissionwith specifiedOperation, andResourceidentifiers. Note: Be sure to useRBACManager.savePermission(Permission)in order to persist any changes to the Role.- Specified by:
createPermissionin interfaceRBACManager- Parameters:
name- the name.operationName- theOperation.setName(String)valueresourceIdentifier- theResource.setIdentifier(String)value- Returns:
- the new Permission.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
createResource
public Resource createResource(String identifier) throws RbacManagerException
Description copied from interface:RBACManagerCreates an implementation specificResource, or return an existingResource, depending on the providedidentifierparameter. Note: Be sure to useRBACManager.saveResource(Resource)in order to persist any changes to the Role.- Specified by:
createResourcein interfaceRBACManager- Parameters:
identifier- the identifier.- Returns:
- the new Resource.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
createRole
public Role createRole(String id, String name)
Description copied from interface:RBACManagerCreates a new role with the given id and role name.- Specified by:
createRolein interfaceRBACManager- Parameters:
id- the role identifier, which must be uniquename- the role name, which must be unique- Returns:
- the new role instance
-
createUserAssignment
public UserAssignment createUserAssignment(String username) throws RbacManagerException
Description copied from interface:RBACManagerCreates an implementation specificUserAssignment, or return an existingUserAssignment, depending on the providedidentifierparameter. Note: Be sure to useRBACManager.saveUserAssignment(UserAssignment)in order to persist any changes to the Role.- Specified by:
createUserAssignmentin interfaceRBACManager- Parameters:
username- the principal reference to the user.- Returns:
- the new UserAssignment object.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
eraseDatabase
public void eraseDatabase()
- Specified by:
eraseDatabasein interfaceRBACManager
-
getAllAssignableRoles
public List<Role> getAllAssignableRoles() throws RbacManagerException
Description copied from interface:RBACManagerReturns a list of all assignable roles- Specified by:
getAllAssignableRolesin interfaceRBACManager- Overrides:
getAllAssignableRolesin classAbstractRBACManager- Returns:
- list of assignable roles
- Throws:
RbacManagerException- if the access to the backend datastore failed- See Also:
RBACManager.getAllAssignableRoles()
-
getAllOperations
public List<? extends Operation> getAllOperations() throws RbacManagerException
- Specified by:
getAllOperationsin interfaceRBACManager- Throws:
RbacManagerException
-
getAllPermissions
public List<? extends Permission> getAllPermissions() throws RbacManagerException
- Specified by:
getAllPermissionsin interfaceRBACManager- Throws:
RbacManagerException
-
getAllResources
public List<? extends Resource> getAllResources() throws RbacManagerException
- Specified by:
getAllResourcesin interfaceRBACManager- Throws:
RbacManagerException
-
getAllRoles
public List<Role> getAllRoles() throws RbacManagerException
Description copied from interface:RBACManagerReturns all roles defined in the datastore.- Specified by:
getAllRolesin interfaceRBACManager- Returns:
- the list of roles defined in the datastore
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
getAllUserAssignments
public List<UserAssignment> getAllUserAssignments() throws RbacManagerException
Description copied from interface:RBACManagerReturns all user assignments defined- Specified by:
getAllUserAssignmentsin interfaceRBACManager- Returns:
- list of assignments
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
closeLdapConnection
protected void closeLdapConnection(LdapConnection ldapConnection)
-
closeContext
protected void closeContext(DirContext context)
-
getRealRoles
protected List<String> getRealRoles() throws RbacManagerException
- Throws:
RbacManagerException
-
getAssignedRoles
public Collection<Role> getAssignedRoles(String username) throws RbacManagerException
Description copied from class:AbstractRBACManagerreturns the active roles for a given principal NOTE: roles that are returned might have have roles themselves, if you just want all permissions then useAbstractRBACManager.getAssignedPermissions(String principal)- Specified by:
getAssignedRolesin interfaceRBACManager- Overrides:
getAssignedRolesin classAbstractRBACManager- Parameters:
username- the user principal to search for assignments- Returns:
- Collection of
Roleobjects. - Throws:
RbacObjectNotFoundException- if the user with the given principal name was not foundRbacManagerException- if the access to the backend datastore failed
-
getAssignedRoles
public Collection<Role> getAssignedRoles(UserAssignment userAssignment) throws RbacManagerException
Description copied from class:AbstractRBACManagerreturns only the roles that are assigned, not the roles that might be child roles of the assigned roles.- Specified by:
getAssignedRolesin interfaceRBACManager- Overrides:
getAssignedRolesin classAbstractRBACManager- Parameters:
userAssignment- the user assignment instance- Returns:
- Collection of
Roleobjects for the provided UserAssignment. - Throws:
RbacObjectNotFoundException- if the assignment could not be foundRbacManagerException- if the access to the backend datastore failed
-
getChildRoleNames
public Map<String,? extends Role> getChildRoleNames(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns all the child roles of a given role as (name, role) pairs.- Specified by:
getChildRoleNamesin interfaceRBACManager- Overrides:
getChildRoleNamesin classAbstractRBACManager- Parameters:
role- the parent role- Returns:
- the list of child roles
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
getChildRoleIds
public Map<String,? extends Role> getChildRoleIds(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns all the child roles of a given role as (role id, role) pairs.- Specified by:
getChildRoleIdsin interfaceRBACManager- Overrides:
getChildRoleIdsin classAbstractRBACManager- Parameters:
role- the parent role- Returns:
- the map of child roles as (role id, role) pairs
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
getParentRoleNames
public Map<String,? extends Role> getParentRoleNames(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns all the parent roles of a given role as map of (name, role) elements.- Specified by:
getParentRoleNamesin interfaceRBACManager- Overrides:
getParentRoleNamesin classAbstractRBACManager- Parameters:
role- the role to check for parent roles- Returns:
- the list of parent roles that have
roleals child - Throws:
RbacManagerException- if the access to the backend datastore failed
-
getParentRoleIds
public Map<String,? extends Role> getParentRoleIds(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns all the parent roles of a given role as map of (id, role) elements.- Specified by:
getParentRoleIdsin interfaceRBACManager- Overrides:
getParentRoleIdsin classAbstractRBACManager- Parameters:
role- the role to check for parents roles- Returns:
- a map of (role id, role) pairs that have
roleas child - Throws:
RbacManagerException- if the access to the backend datastore failed
-
getEffectiveRoles
public Set<? extends Role> getEffectiveRoles(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns all effective roles. Which means a list with the current role and all child roles recursively.- Specified by:
getEffectiveRolesin interfaceRBACManager- Overrides:
getEffectiveRolesin classAbstractRBACManager- Parameters:
role- the role to use as starting point- Returns:
- the set of roles that are found as children of the given role
- Throws:
RbacObjectNotFoundException- if the given role was not foundRbacManagerException- if the access to the backend datastore failed
-
getGlobalResource
public Resource getGlobalResource() throws RbacManagerException
Description copied from interface:RBACManagerReturns the global resource object- Specified by:
getGlobalResourcein interfaceRBACManager- Overrides:
getGlobalResourcein classAbstractRBACManager- Returns:
- the global resource object
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
getOperation
public Operation getOperation(String operationName) throws RbacManagerException
- Specified by:
getOperationin interfaceRBACManager- Throws:
RbacManagerException
-
getPermission
public Permission getPermission(String permissionName) throws RbacManagerException
- Specified by:
getPermissionin interfaceRBACManager- Throws:
RbacManagerException
-
getResource
public Resource getResource(String resourceIdentifier) throws RbacManagerException
- Specified by:
getResourcein interfaceRBACManager- Throws:
RbacManagerException
-
getRole
public Role getRole(String roleName) throws RbacManagerException
Description copied from interface:RBACManagerReturns the role identified by the given name- Specified by:
getRolein interfaceRBACManager- Parameters:
roleName- the role name- Returns:
- the role instance, if a role by this name was found
- Throws:
RbacObjectNotFoundException- if not role was found with the given nameRbacManagerException- if the access to the underlying datastore failed
-
checkIfLdapRole
protected boolean checkIfLdapRole(String roleName) throws RbacManagerException
- Throws:
RbacManagerException
-
getRoleById
public Role getRoleById(String id) throws RbacObjectNotFoundException, RbacManagerException
Description copied from interface:RBACManagerReturns the role identified by the given ID- Specified by:
getRoleByIdin interfaceRBACManager- Parameters:
id- the role id- Returns:
- the role object, if the role with the given id exists
- Throws:
RbacObjectNotFoundException- if no role was found with the given idRbacManagerException- if the access to the underlying datastore failed
-
getRoles
public Map<String,? extends Role> getRoles(Collection<String> roleNames) throws RbacManagerException
Description copied from interface:RBACManagerReturns the role instances for the given role names.- Specified by:
getRolesin interfaceRBACManager- Overrides:
getRolesin classAbstractRBACManager- Parameters:
roleNames- the list of role names.- Returns:
- a map of (name,role) pairs
- Throws:
RbacObjectNotFoundException- if one of the given roles was not foundRbacManagerException- if the access to the backend datastore failed
-
getUnassignedRoles
public Collection<Role> getUnassignedRoles(String username) throws RbacManagerException
Description copied from interface:RBACManagerGet a list of all assignable roles that are currently not assigned to the specific user.- Specified by:
getUnassignedRolesin interfaceRBACManager- Overrides:
getUnassignedRolesin classAbstractRBACManager- Parameters:
username- the user principal name- Returns:
- the list of roles not assigned to the given user
- Throws:
RbacManagerException- if the access to the backend datastore failedRbacObjectNotFoundException- if the user with the given principal was not found
-
getUserAssignment
public UserAssignment getUserAssignment(String username) throws RbacManagerException
- Specified by:
getUserAssignmentin interfaceRBACManager- Throws:
RbacManagerException
-
getUserAssignmentsForRoles
public List<? extends UserAssignment> getUserAssignmentsForRoles(Collection<String> roleIds) throws RbacManagerException
Description copied from interface:RBACManagerReturns the assignments for the given roles- Specified by:
getUserAssignmentsForRolesin interfaceRBACManager- Parameters:
roleIds- collection of role names- Throws:
RbacManagerException- if the access to the backend datastore failed
-
operationExists
public boolean operationExists(Operation operation)
- Specified by:
operationExistsin interfaceRBACManager- Overrides:
operationExistsin classAbstractRBACManager
-
operationExists
public boolean operationExists(String name)
- Specified by:
operationExistsin interfaceRBACManager- Overrides:
operationExistsin classAbstractRBACManager
-
permissionExists
public boolean permissionExists(Permission permission)
- Specified by:
permissionExistsin interfaceRBACManager- Overrides:
permissionExistsin classAbstractRBACManager
-
permissionExists
public boolean permissionExists(String name)
Description copied from interface:RBACManagerTests for the existence of a permission.- Specified by:
permissionExistsin interfaceRBACManager- Overrides:
permissionExistsin classAbstractRBACManager- Parameters:
name- the name to test for.- Returns:
- true if permission exists.
-
rbacInit
public void rbacInit(boolean freshdb)
- Specified by:
rbacInitin interfaceRBACManagerListener
-
rbacPermissionRemoved
public void rbacPermissionRemoved(Permission permission)
- Specified by:
rbacPermissionRemovedin interfaceRBACManagerListener
-
rbacPermissionSaved
public void rbacPermissionSaved(Permission permission)
- Specified by:
rbacPermissionSavedin interfaceRBACManagerListener
-
rbacRoleRemoved
public void rbacRoleRemoved(Role role)
- Specified by:
rbacRoleRemovedin interfaceRBACManagerListener
-
rbacRoleSaved
public void rbacRoleSaved(Role role)
- Specified by:
rbacRoleSavedin interfaceRBACManagerListener
-
rbacUserAssignmentRemoved
public void rbacUserAssignmentRemoved(UserAssignment userAssignment)
- Specified by:
rbacUserAssignmentRemovedin interfaceRBACManagerListener
-
rbacUserAssignmentSaved
public void rbacUserAssignmentSaved(UserAssignment userAssignment)
- Specified by:
rbacUserAssignmentSavedin interfaceRBACManagerListener
-
removeListener
public void removeListener(RBACManagerListener listener)
- Specified by:
removeListenerin interfaceRBACManager- Overrides:
removeListenerin classAbstractRBACManager
-
removeOperation
public void removeOperation(Operation operation) throws RbacManagerException
- Specified by:
removeOperationin interfaceRBACManager- Throws:
RbacManagerException
-
removeOperation
public void removeOperation(String operationName) throws RbacManagerException
- Specified by:
removeOperationin interfaceRBACManager- Overrides:
removeOperationin classAbstractRBACManager- Throws:
RbacManagerException
-
removePermission
public void removePermission(Permission permission) throws RbacManagerException
- Specified by:
removePermissionin interfaceRBACManager- Throws:
RbacManagerException
-
removePermission
public void removePermission(String permissionName) throws RbacManagerException
- Specified by:
removePermissionin interfaceRBACManager- Overrides:
removePermissionin classAbstractRBACManager- Throws:
RbacManagerException
-
removeResource
public void removeResource(Resource resource) throws RbacManagerException
- Specified by:
removeResourcein interfaceRBACManager- Throws:
RbacManagerException
-
removeResource
public void removeResource(String resourceIdentifier) throws RbacManagerException
- Specified by:
removeResourcein interfaceRBACManager- Overrides:
removeResourcein classAbstractRBACManager- Throws:
RbacManagerException
-
removeRole
public void removeRole(Role role) throws RbacManagerException
Description copied from interface:RBACManagerRemoves the given role from the datastore.- Specified by:
removeRolein interfaceRBACManager- Parameters:
role- the role to remove- Throws:
RbacManagerException- if the access to the backend datastore failedRbacObjectNotFoundException- if the given role was not foundRbacObjectInvalidException- if the given role has invalid data
-
removeRole
public void removeRole(String roleName) throws RbacManagerException
Description copied from interface:RBACManagerRemoves the role with the given name from the datastore.- Specified by:
removeRolein interfaceRBACManager- Overrides:
removeRolein classAbstractRBACManager- Parameters:
roleName- the role name- Throws:
RbacObjectNotFoundException- if the role with the given name was not foundRbacManagerException- if the access to the backend datastore failed
-
removeUserAssignment
public void removeUserAssignment(String username) throws RbacManagerException
Description copied from interface:RBACManagerMethod removeAssignment- Specified by:
removeUserAssignmentin interfaceRBACManager- Overrides:
removeUserAssignmentin classAbstractRBACManager- Parameters:
username- the principal for which the assignment should be removed- Throws:
RbacObjectNotFoundException- if the user with the given principal name was not foundRbacObjectInvalidException- if the principal string was invalidRbacManagerException- if the access to the backend datastore failed
-
removeUserAssignment
public void removeUserAssignment(UserAssignment userAssignment) throws RbacManagerException
Description copied from interface:RBACManagerMethod removeAssignment- Specified by:
removeUserAssignmentin interfaceRBACManager- Parameters:
userAssignment- the assignment to remove- Throws:
RbacObjectNotFoundException- if the assignment was not foundRbacObjectInvalidException- if the provided assignment instance has invalid dataRbacManagerException- if the access to the backend datastore failed
-
resourceExists
public boolean resourceExists(Resource resource)
- Specified by:
resourceExistsin interfaceRBACManager- Overrides:
resourceExistsin classAbstractRBACManager
-
resourceExists
public boolean resourceExists(String identifier)
- Specified by:
resourceExistsin interfaceRBACManager- Overrides:
resourceExistsin classAbstractRBACManager
-
roleExists
public boolean roleExists(Role role) throws RbacManagerException
Description copied from interface:RBACManagerReturns true, if the given role exists.- Specified by:
roleExistsin interfaceRBACManager- Overrides:
roleExistsin classAbstractRBACManager- Parameters:
role- the role to check- Returns:
true, if the role exists, otherwisefalse- Throws:
RbacManagerException- if the access to the backend datastore failed
-
roleExists
public boolean roleExists(String name) throws RbacManagerException
Description copied from interface:RBACManagerTests for the existence of a Role.- Specified by:
roleExistsin interfaceRBACManager- Overrides:
roleExistsin classAbstractRBACManager- Returns:
- true if role exists in store.
- Throws:
RbacManagerException- if the access to the backend datastore failed
-
roleExistsById
public boolean roleExistsById(String id) throws RbacManagerException
Description copied from interface:RBACManagerReturnstrue, if a role with the given id exists.- Specified by:
roleExistsByIdin interfaceRBACManager- Overrides:
roleExistsByIdin classAbstractRBACManager- Parameters:
id- the role id- Returns:
true, if the role with the given id exists, otherwisefalse- Throws:
RbacManagerException- if the access to the backend datastore failed
-
saveOperation
public Operation saveOperation(Operation operation) throws RbacManagerException
Description copied from interface:RBACManagerSave the new or existing operation to the store.- Specified by:
saveOperationin interfaceRBACManager- Parameters:
operation- the operation to save (new or existing)- Returns:
- the Operation that was saved.
- Throws:
RbacObjectInvalidException- if the object is not valid and cannot be savedRbacManagerException- if the access to the backend datastore failed
-
savePermission
public Permission savePermission(Permission permission) throws RbacManagerException
- Specified by:
savePermissionin interfaceRBACManager- Throws:
RbacManagerException
-
saveResource
public Resource saveResource(Resource resource) throws RbacManagerException
- Specified by:
saveResourcein interfaceRBACManager- Throws:
RbacManagerException
-
saveRole
public Role saveRole(Role role) throws RbacManagerException
Description copied from interface:RBACManagerPersists the given role to the backend datastore.- Specified by:
saveRolein interfaceRBACManager- Parameters:
role- the role to save- Returns:
- the persisted role, if the method was successful
- Throws:
RbacObjectInvalidException- if the given role object was not validRbacManagerException- if the access to the backend datastore failed
-
saveRoles
public void saveRoles(Collection<Role> roles) throws RbacManagerException
Description copied from interface:RBACManagerPersists all of the given roles to the backend datastore. Implementations should try to save all role instances and throw exceptions afterwards.- Specified by:
saveRolesin interfaceRBACManager- Parameters:
roles- the list of roles to save- Throws:
RbacObjectInvalidException- if one of the given role objects was not validRbacManagerException- if the access to the backend datastore failed
-
saveUserAssignment
public UserAssignment saveUserAssignment(UserAssignment userAssignment) throws RbacManagerException
Description copied from interface:RBACManagerMethod saveUserAssignment- Specified by:
saveUserAssignmentin interfaceRBACManager- Parameters:
userAssignment- the user assignment instance to save- Throws:
RbacObjectInvalidException- if the instance has invalid data and cannot be savedRbacManagerException- if the access to the backend datastore failed
-
userAssignmentExists
public boolean userAssignmentExists(String principal)
- Specified by:
userAssignmentExistsin interfaceRBACManager- Overrides:
userAssignmentExistsin classAbstractRBACManager
-
userAssignmentExists
public boolean userAssignmentExists(UserAssignment assignment)
- Specified by:
userAssignmentExistsin interfaceRBACManager- Overrides:
userAssignmentExistsin classAbstractRBACManager
-
getRbacImpl
public RBACManager getRbacImpl()
-
setRbacImpl
public void setRbacImpl(RBACManager rbacImpl)
-
isWritableLdap
public boolean isWritableLdap()
-
setWritableLdap
public void setWritableLdap(boolean writableLdap)
-
getLdapRoleMapper
public LdapRoleMapper getLdapRoleMapper()
-
setLdapRoleMapper
public void setLdapRoleMapper(LdapRoleMapper ldapRoleMapper)
-
isFinalImplementation
public boolean isFinalImplementation()
- Specified by:
isFinalImplementationin interfaceRBACManager- Overrides:
isFinalImplementationin classAbstractRBACManager- Returns:
- true if this implementation is a final one and not a wrapper (configurable, cached)
-
getDescriptionKey
public String getDescriptionKey()
- Specified by:
getDescriptionKeyin interfaceRBACManager- Returns:
- a key to be able to customize label in UI
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:RBACManagerIs the RBACManager read only? if so then create and modify actions are to be disabled- Specified by:
isReadOnlyin interfaceRBACManager- Returns:
- boolean true if user manager is read only
-
-