mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
add a list of namespace URIs for properties, which should be always editable for a frozen node
This commit is contained in:
@@ -177,6 +177,11 @@
|
||||
</bean>
|
||||
|
||||
<util:constant id="propThumbnailModification" static-field="org.alfresco.model.ContentModel.PROP_LAST_THUMBNAIL_MODIFICATION_DATA" />
|
||||
|
||||
<!-- Defines a list of namespace URIs for properties, which should be always editable for a frozen node-->
|
||||
<util:list id="frozen_alwaysEditURIs" value-type="java.lang.String">
|
||||
<value>http://www.alfresco.org/model/system/1.0</value>
|
||||
</util:list>
|
||||
|
||||
<bean name="updateFrozenPropertyCheck"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.util.PropertyModificationAllowedCheck">
|
||||
@@ -185,6 +190,7 @@
|
||||
<ref bean="propThumbnailModification" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="editableURIs" ref="frozen_alwaysEditURIs" />
|
||||
</bean>
|
||||
|
||||
<bean id="rma.vitalRecordDefinition" class="org.alfresco.module.org_alfresco_module_rm.model.rma.aspect.VitalRecordDefinitionAspect" parent="rm.baseBehaviour">
|
||||
|
@@ -45,6 +45,29 @@ public class PropertyModificationAllowedCheck
|
||||
* List of qnames that can be modified
|
||||
*/
|
||||
private List<QName> whiteList;
|
||||
|
||||
/**
|
||||
* List of model URI's for which the properties can be updated
|
||||
*/
|
||||
private List<String> editableURIs;
|
||||
|
||||
/**
|
||||
* Setter for list of model URI's
|
||||
* @param editableURIs List<String>
|
||||
*/
|
||||
public void setEditableURIs(List<String> editableURIs)
|
||||
{
|
||||
this.editableURIs = editableURIs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for list of model URI's
|
||||
* @return return the list of model URI's
|
||||
*/
|
||||
public List<String> getEditableURIs()
|
||||
{
|
||||
return editableURIs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for list of qnames
|
||||
@@ -93,7 +116,7 @@ public class PropertyModificationAllowedCheck
|
||||
if (before.get(key) != null && after.get(key) != null && !(after.get(key).equals(before.get(key))))
|
||||
{
|
||||
//Property modified check to see if allowed
|
||||
proceed = whiteList.contains(key);
|
||||
proceed = whiteList.contains(key) || getEditableURIs().contains(key.getNamespaceURI());
|
||||
if (!proceed)
|
||||
{
|
||||
break;
|
||||
@@ -103,4 +126,5 @@ public class PropertyModificationAllowedCheck
|
||||
return proceed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ public class PropertyModificationAllowedCheckUnitTest
|
||||
private QName qName, qName2;
|
||||
|
||||
private List<QName> list;
|
||||
private List<String> editableURIs;
|
||||
|
||||
@Mock
|
||||
private Serializable serializable, serializable2;
|
||||
@@ -74,6 +75,9 @@ public class PropertyModificationAllowedCheckUnitTest
|
||||
before.put(qName, serializable);
|
||||
after.put(qName, serializable2);
|
||||
list = new ArrayList();
|
||||
editableURIs =new ArrayList<>();
|
||||
propertyModificationAllowedCheck.setWhiteList(list);
|
||||
propertyModificationAllowedCheck.setEditableURIs(editableURIs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user