mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-598: A records manager can assign the "Manage Rules" capability to a role.
* new capability added to Admin role by default * 2.1 capability patch updated git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@46753 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -112,6 +112,9 @@ public class RMv21CapabilityPatch extends AbstractModuleComponent
|
||||
FilePlanRoleService.ROLE_POWER_USER,
|
||||
FilePlanRoleService.ROLE_RECORDS_MANAGER,
|
||||
FilePlanRoleService.ROLE_SECURITY_OFFICER);
|
||||
addCapability(filePlan,
|
||||
"ManageRules",
|
||||
FilePlanRoleService.ROLE_ADMIN);
|
||||
|
||||
}
|
||||
|
||||
@@ -139,11 +142,23 @@ public class RMv21CapabilityPatch extends AbstractModuleComponent
|
||||
for (String roleName : roles)
|
||||
{
|
||||
Role role = filePlanRoleService.getRole(filePlan, roleName);
|
||||
|
||||
if (role != null)
|
||||
{
|
||||
// get the roles current capabilities
|
||||
Set<Capability> capabilities = role.getCapabilities();
|
||||
capabilities.add(capability);
|
||||
filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities);
|
||||
|
||||
// only update if the capability is missing
|
||||
if (capabilities.contains(capability) == false)
|
||||
{
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName());
|
||||
}
|
||||
|
||||
capabilities.add(capability);
|
||||
filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -345,8 +345,11 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
|
||||
String user = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||
authorityService.addAuthority(role.getRoleGroupName(), user);
|
||||
|
||||
// add the dynamic admin authority
|
||||
authorityService.addAuthority(role.getRoleGroupName(), filePlanAuthenticationService.getRmAdminUserName());
|
||||
if (filePlanAuthenticationService.getRmAdminUserName().equals(user) == false)
|
||||
{
|
||||
// add the dynamic admin authority
|
||||
authorityService.addAuthority(role.getRoleGroupName(), filePlanAuthenticationService.getRmAdminUserName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user