APPS-139 changes around capabilities

This commit is contained in:
Roxana Lucanu
2020-06-03 15:49:00 +03:00
parent 20ff45e1d4
commit ef68bddb06
2 changed files with 5 additions and 9 deletions

View File

@@ -158,12 +158,7 @@
parent="declarativeCapability">
<property name="name" value="FileUnfiledRecords"/>
<property name="permission" value="FileUnfiledRecords"/>
<property name="kinds">
<list>
<value>RECORD_FOLDER</value>
<value>RECORD</value>
</list>
</property>
<property name="kind" value="RECORD" />
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/> <!-- Checks if the user has the filling capability -->
@@ -281,6 +276,7 @@
<property name="kinds">
<list>
<value>RECORD</value>
<value>RECORD_FOLDER</value>
</list>
</property>
<property name="conditions">

View File

@@ -74,7 +74,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
public static final String PARAM_FILE_PLAN = "file-plan";
public static final String PARAM_PATH = "path";
private static final String FILE_UNFILED_RECORDS_CAPABILITY = "FileUnfiledRecords";
private static final String EDIT_RECORD_METADATA_CAPABILITY = "EditRecordMetadata";
/** Sync Model URI */
private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0";
@@ -213,9 +213,9 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
// create record from latest version
if (destinationRecordFolder != null)
{
boolean hasFilingCapability = capabilityService.hasCapability(destinationRecordFolder, FILE_UNFILED_RECORDS_CAPABILITY);
boolean hasCapability = capabilityService.hasCapability(destinationRecordFolder, EDIT_RECORD_METADATA_CAPABILITY);
// validate destination record folder
if (hasFilingCapability)
if (hasCapability)
{
NodeRef recordedVersion = recordableVersionService.createRecordFromLatestVersion(destinationRecordFolder, actionedUponNodeRef);
recordService.file(recordedVersion);