mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1506 (Deleting In-Place Reader or Writer roles breaks Record declaration)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@70987 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -784,6 +784,12 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
|
||||
throw new AlfrescoRuntimeException("Can not delete the records management administration role.");
|
||||
}
|
||||
|
||||
// ensure that we are not trying to delete a system role
|
||||
if (FilePlanRoleService.SYSTEM_ROLES.contains(role))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("'" + role + "' is a system role and cannot be deleted.");
|
||||
}
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Boolean doWork() throws Exception
|
||||
|
@@ -22,6 +22,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
@@ -45,7 +46,7 @@ public class RmRoleDelete extends RoleDeclarativeWebScript
|
||||
// Role name
|
||||
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
|
||||
String roleParam = templateVars.get("rolename");
|
||||
if (roleParam == null)
|
||||
if (StringUtils.isBlank(roleParam))
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "No role name was provided on the URL.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user