RM-452: RM seurity context will break core Alfresco if Alfresco's public services change

* ensure the '*' definition is at the end of the updated value
  * add missing method definitions



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@42897 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-10-20 02:17:49 +00:00
parent d016261614
commit 6b674b414e
3 changed files with 41 additions and 7 deletions

View File

@@ -95,7 +95,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
PropertyValue beanValue = beanDef.getPropertyValues().getPropertyValue(PROP_OBJECT_DEFINITION_SOURCE);
String beanStringValue = (String)((TypedStringValue)beanValue.getValue()).getValue();
String mergedStringValue = merge(beanStringValue);
beanDef.getPropertyValues().addPropertyValue(PROP_OBJECT_DEFINITION_SOURCE, new TypedStringValue(mergedStringValue));
beanDef.getPropertyValues().addPropertyValue(PROP_OBJECT_DEFINITION_SOURCE, new TypedStringValue(mergedStringValue));
}
}
}
@@ -144,6 +144,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
private String merge(String beanStringValue)
{
Map<String, String> map = convertToMap(beanStringValue);
String allString = null;
for (Map.Entry<String, String> entry : map.entrySet())
{
@@ -151,7 +152,14 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
String propKey = PROPERTY_PREFIX + key;
if (properties.containsKey(propKey) == true)
{
map.put(key, entry.getValue() + "," + properties.getProperty(propKey));
if (propKey.endsWith("*") == true)
{
allString = key + "=" + entry.getValue() + "," + properties.getProperty(propKey);
}
else
{
map.put(key, entry.getValue() + "," + properties.getProperty(propKey));
}
}
else
{
@@ -162,7 +170,12 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
}
}
return convertToString(map);
String result = convertToString(map);
if (allString != null)
{
result = result + allString;
}
return result;
}
/**
@@ -190,7 +203,10 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
StringBuffer buffer = new StringBuffer(256);
for (Map.Entry<String, String> entry : map.entrySet())
{
buffer.append(entry.getKey()).append("=").append(entry.getValue()).append("\n");
if (entry.getKey().endsWith("*") == false)
{
buffer.append(entry.getKey()).append("=").append(entry.getValue()).append("\n");
}
}
return buffer.toString();