diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java index 2bcf6201fa..68a7ae5722 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java @@ -57,6 +57,7 @@ import org.alfresco.service.cmr.search.PermissionEvaluationMode; import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.security.AccessStatus; import org.aopalliance.intercept.MethodInvocation; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; @@ -76,16 +77,15 @@ public class RMAfterInvocationProvider extends RMSecurityCommon private long maxPermissionCheckTimeMillis; - public boolean supports(ConfigAttribute attribute) + public boolean supports(ConfigAttribute configAttribute) { - if ((attribute.getAttribute() != null) && (attribute.getAttribute().startsWith(AFTER_RM))) + boolean supports = false; + String attribute = configAttribute.getAttribute(); + if (StringUtils.isNotBlank(attribute) && attribute.startsWith(AFTER_RM)) { - return true; - } - else - { - return false; + supports = true; } + return supports; } @SuppressWarnings("rawtypes") diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMEntryVoter.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMEntryVoter.java index 0cd20a2a86..bb607675ca 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMEntryVoter.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMEntryVoter.java @@ -36,6 +36,7 @@ import org.alfresco.repo.transaction.TransactionalResourceHelper; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.NamespacePrefixResolver; import org.aopalliance.intercept.MethodInvocation; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; @@ -90,22 +91,21 @@ public class RMEntryVoter extends RMSecurityCommon * @see net.sf.acegisecurity.vote.AccessDecisionVoter#supports(net.sf.acegisecurity.ConfigAttribute) */ @Override - public boolean supports(ConfigAttribute attribute) + public boolean supports(ConfigAttribute configAttribute) { - if ((attribute.getAttribute() != null) && - (attribute.getAttribute().equals(ConfigAttributeDefinition.RM_ABSTAIN) || - attribute.getAttribute().equals(ConfigAttributeDefinition.RM_QUERY) || - attribute.getAttribute().equals(ConfigAttributeDefinition.RM_ALLOW) || - attribute.getAttribute().equals(ConfigAttributeDefinition.RM_DENY) || - attribute.getAttribute().startsWith(ConfigAttributeDefinition.RM_CAP) || - attribute.getAttribute().startsWith(ConfigAttributeDefinition.RM))) + boolean supports = false; + String attribute = configAttribute.getAttribute(); + if (StringUtils.isNotBlank(attribute) && + (attribute.equals(ConfigAttributeDefinition.RM_ABSTAIN) || + attribute.equals(ConfigAttributeDefinition.RM_QUERY) || + attribute.equals(ConfigAttributeDefinition.RM_ALLOW) || + attribute.equals(ConfigAttributeDefinition.RM_DENY) || + attribute.startsWith(ConfigAttributeDefinition.RM_CAP) || + attribute.startsWith(ConfigAttributeDefinition.RM))) { - return true; - } - else - { - return false; + supports = true; } + return supports; } /**