mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-563 (Add group id and title to Capability API and definitions)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@43933 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -6,57 +6,57 @@
|
||||
<!-- Assignable Capabilities -->
|
||||
|
||||
<bean id="rmAccessAuditCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="AccessAudit"/>
|
||||
<property name="permission" value="AccessAudit"/>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="AccessAudit"/>
|
||||
<property name="permission" value="AccessAudit"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeclareAuditAsRecordCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeclareAuditAsRecord" />
|
||||
<property name="permission" value="DeclareAuditAsRecord" />
|
||||
</bean>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="DeclareAuditAsRecord" />
|
||||
<property name="permission" value="DeclareAuditAsRecord" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeleteAuditCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeleteAudit" />
|
||||
<property name="permission" value="DeleteAudit" />
|
||||
</bean>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="DeleteAudit" />
|
||||
<property name="permission" value="DeleteAudit" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmEnableDisableAuditByTypesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="EnableDisableAuditByTypes" />
|
||||
<property name="permission" value="EnableDisableAuditByTypes" />
|
||||
</bean>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="EnableDisableAuditByTypes" />
|
||||
<property name="permission" value="EnableDisableAuditByTypes" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmExportAuditCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ExportAudit" />
|
||||
<property name="permission" value="ExportAudit" />
|
||||
</bean>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="ExportAudit" />
|
||||
<property name="permission" value="ExportAudit" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmSelectAuditMetadataCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="SelectAuditMetadata" />
|
||||
<property name="permission" value="SelectAuditMetadata" />
|
||||
</bean>
|
||||
parent="rmAuditGroup">
|
||||
<property name="name" value="SelectAuditMetadata" />
|
||||
<property name="permission" value="SelectAuditMetadata" />
|
||||
</bean>
|
||||
|
||||
<!-- Non-Assignable Capabilities -->
|
||||
|
||||
<bean id="rmAuditAdmin"
|
||||
parent="compositeCapability">
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="AuditAdmin"/>
|
||||
<property name="private" value="true"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmAccessAuditCapability"/>
|
||||
<ref bean="rmDeclareAuditAsRecordCapability"/>
|
||||
<ref bean="rmDeleteAuditCapability"/>
|
||||
<ref bean="rmEnableDisableAuditByTypesCapability"/>
|
||||
<ref bean="rmExportAuditCapability"/>
|
||||
<ref bean="rmSelectAuditMetadataCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="private" value="true"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmAccessAuditCapability"/>
|
||||
<ref bean="rmDeclareAuditAsRecordCapability"/>
|
||||
<ref bean="rmDeleteAuditCapability"/>
|
||||
<ref bean="rmEnableDisableAuditByTypesCapability"/>
|
||||
<ref bean="rmExportAuditCapability"/>
|
||||
<ref bean="rmSelectAuditMetadataCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -2,113 +2,117 @@
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<beans>
|
||||
|
||||
<!-- Assignable Capabilities -->
|
||||
|
||||
<!-- Cut off -->
|
||||
<bean id="rmApproveRecordsScheduledForCutoffCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ApproveRecordsScheduledForCutoff"/>
|
||||
<property name="permission" value="ApproveRecordsScheduledForCutoff"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmCutoffGroup">
|
||||
<property name="name" value="ApproveRecordsScheduledForCutoff"/>
|
||||
<property name="permission" value="ApproveRecordsScheduledForCutoff"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Transfer -->
|
||||
<bean id="rmAuthorizeAllTransfersCapability"
|
||||
parent="compositeCapability">
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="AuthorizeAllTransfers"/>
|
||||
<property name="permission" value="AuthorizeAllTransfers"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmInitiateAllTransfersCapability"/>
|
||||
<ref bean="rmCompleteAllTransfersCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="permission" value="AuthorizeAllTransfers"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmInitiateAllTransfersCapability"/>
|
||||
<ref bean="rmCompleteAllTransfersCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<!-- Accession -->
|
||||
<bean id="rmAuthorizeNominatedTransfersCapability"
|
||||
parent="compositeCapability">
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="AuthorizeNominatedTransfers"/>
|
||||
<property name="permission" value="AuthorizeNominatedTransfers"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmInitiateNominatedTransfersCapability"/>
|
||||
<ref bean="rmCompleteNominatedTransfersCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="permission" value="AuthorizeNominatedTransfers"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmInitiateNominatedTransfersCapability"/>
|
||||
<ref bean="rmCompleteNominatedTransfersCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<!-- Destroy -->
|
||||
<bean id="rmDestroyRecordsScheduledForDestructionCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DestroyRecordsScheduledForDestruction"/>
|
||||
<property name="permission" value="DestroyRecordsScheduledForDestruction"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.destroyIsScheduled" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DestroyRecordsScheduledForDestruction"/>
|
||||
<property name="permission" value="DestroyRecordsScheduledForDestruction"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.destroyIsScheduled" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<!-- Unscheduled Destroy -->
|
||||
<bean id="rmDestroyRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DestroyRecords"/>
|
||||
<property name="permission" value="DestroyRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.destroyMayBeScheduled" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DestroyRecords"/>
|
||||
<property name="permission" value="DestroyRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.destroyMayBeScheduled" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<!-- Manually Change Disposition Dates -->
|
||||
<bean id="rmManuallyChangeDispositionDatesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ManuallyChangeDispositionDates"/>
|
||||
<property name="permission" value="ManuallyChangeDispositionDates"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.hasDispositionAsOfDate" value="true"/>
|
||||
<entry key="capabilityCondition.isTransferring" value="false" />
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ManuallyChangeDispositionDates"/>
|
||||
<property name="permission" value="ManuallyChangeDispositionDates"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.hasDispositionAsOfDate" value="true"/>
|
||||
<entry key="capabilityCondition.isTransferring" value="false" />
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<!-- Non-assignable Capabilities -->
|
||||
|
@@ -6,16 +6,17 @@
|
||||
<!-- Assignable Capabilities -->
|
||||
|
||||
<bean id="rmCreateModifyDestroyFileplanMetadataCapability"
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="CreateModifyDestroyFileplanMetadata"/>
|
||||
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="CreateModifyDestroyFileplanMetadata"/>
|
||||
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmCreateRootRecordCategoryCapability"/>
|
||||
<ref bean="rmCreateModifyDestroyRecordCategoryCapability"/>
|
||||
<ref bean="rmCreateModifyDestroyUnfiledRecordContainerCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<list>
|
||||
<ref bean="rmCreateRootRecordCategoryCapability"/>
|
||||
<ref bean="rmCreateModifyDestroyRecordCategoryCapability"/>
|
||||
<ref bean="rmCreateModifyDestroyUnfiledRecordContainerCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<!-- Unassignable Capabilities -->
|
||||
|
@@ -6,44 +6,44 @@
|
||||
<!-- Public Capabilities -->
|
||||
|
||||
<bean id="rmExtendRetentionPeriodOrFreezeCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ExtendRetentionPeriodOrFreeze"/>
|
||||
<property name="permission" value="ExtendRetentionPeriodOrFreeze"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmHoldControlsGroup">
|
||||
<property name="name" value="ExtendRetentionPeriodOrFreeze"/>
|
||||
<property name="permission" value="ExtendRetentionPeriodOrFreeze"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmUnfreezeCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="Unfreeze"/>
|
||||
<property name="permission" value="Unfreeze"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrHold" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmHoldControlsGroup">
|
||||
<property name="name" value="Unfreeze"/>
|
||||
<property name="permission" value="Unfreeze"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrHold" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmViewUpdateReasonsForFreezeCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ViewUpdateReasonsForFreeze"/>
|
||||
<property name="permission" value="ViewUpdateReasonsForFreeze"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozenOrHold" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmHoldControlsGroup">
|
||||
<property name="name" value="ViewUpdateReasonsForFreeze"/>
|
||||
<property name="permission" value="ViewUpdateReasonsForFreeze"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozenOrHold" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -6,29 +6,31 @@
|
||||
<!-- Assignable Capabilities -->
|
||||
|
||||
<bean id="rmCreateAndAssociateSelectionListsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateAndAssociateSelectionLists"/>
|
||||
<property name="permission" value="CreateAndAssociateSelectionLists"/>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateAndAssociateSelectionLists"/>
|
||||
<property name="permission" value="CreateAndAssociateSelectionLists"/>
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmEditSelectionListsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="EditSelectionLists" />
|
||||
<property name="permission" value="EditSelectionLists" />
|
||||
</bean>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="EditSelectionLists" />
|
||||
<property name="permission" value="EditSelectionLists" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<!-- Non-Assignable Capabilities -->
|
||||
|
||||
<bean id="rmListAdmin"
|
||||
parent="compositeCapability">
|
||||
parent="compositeCapability">
|
||||
<property name="name" value="ListAdmin"/>
|
||||
<property name="private" value="true"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmCreateAndAssociateSelectionListsCapability"/>
|
||||
<ref bean="rmEditSelectionListsCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="private" value="true"/>
|
||||
<property name="capabilities">
|
||||
<list>
|
||||
<ref bean="rmCreateAndAssociateSelectionListsCapability"/>
|
||||
<ref bean="rmEditSelectionListsCapability"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -4,48 +4,50 @@
|
||||
<beans>
|
||||
|
||||
<bean id="rmViewRecordsCapability"
|
||||
parent="rmBaseCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability">
|
||||
<property name="name" value="ViewRecords" />
|
||||
</bean>
|
||||
parent="rmBaseCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability">
|
||||
<property name="name" value="ViewRecords" />
|
||||
<property name="groupId" value="records" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmUndeclareRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UndeclareRecords"/>
|
||||
<property name="permission" value="UndeclareRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UndeclareRecords"/>
|
||||
<property name="permission" value="UndeclareRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="records" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyRecordsInCuttoffFoldersCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyRecordsInCutoffFolders"/>
|
||||
<property name="permission" value="CreateModifyRecordsInCutoffFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmCutoffGroup">
|
||||
<property name="name" value="CreateModifyRecordsInCutoffFolders"/>
|
||||
<property name="permission" value="CreateModifyRecordsInCutoffFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmFileCapability"
|
||||
@@ -87,158 +89,125 @@
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeclareRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeclareRecords"/>
|
||||
<property name="permission" value="DeclareRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeclareRecordsInClosedFoldersCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeclareRecordsInClosedFolders"/>
|
||||
<property name="permission" value="DeclareRecordsInClosedFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="true"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeclareRecords"/>
|
||||
<property name="permission" value="DeclareRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="records"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeleteRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeleteRecords"/>
|
||||
<property name="permission" value="DeleteRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DeleteRecords"/>
|
||||
<property name="permission" value="DeleteRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmEditDeclaredRecordMetadataCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="EditDeclaredRecordMetadata"/>
|
||||
<property name="permission" value="EditDeclaredRecordMetadata"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="EditDeclaredRecordMetadata"/>
|
||||
<property name="permission" value="EditDeclaredRecordMetadata"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="metadataControl"/>
|
||||
</bean>
|
||||
|
||||
<!-- TODO .. this is being used for the wrong thing! ... should indicate that the use can edit the non-record meta-data of a record -->
|
||||
<!-- TODO .. may need some kind of 'prep' record capability you get with file? .. I think this is what this is being used for atm -->
|
||||
<!-- TODO .. this is being used for the wrong thing! ... should indicate that the use can edit the non-record meta-data of a record -->
|
||||
<!-- TODO .. may need some kind of 'prep' record capability you get with file? .. I think this is what this is being used for atm -->
|
||||
<bean id="rmEditNonRecordMetadataCapability"
|
||||
parent="declarativeCapability"
|
||||
parent="declarativeCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.EditCapability">
|
||||
<property name="name" value="EditNonRecordMetadata"/>
|
||||
<property name="permission" value="EditNonRecordMetadata"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.fileable" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="name" value="EditNonRecordMetadata"/>
|
||||
<property name="permission" value="EditNonRecordMetadata"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.fileable" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="metadataControl"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmEditRecordMetadataCapability"
|
||||
parent="rmBaseCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.EditCapability">
|
||||
<property name="name" value="EditRecordMetadata"/>
|
||||
<property name="permission" value="EditRecordMetadata"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="name" value="EditRecordMetadata"/>
|
||||
<property name="permission" value="EditRecordMetadata"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="metadataControl"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmMoveRecordsCapability"
|
||||
parent="declarativeCapability" >
|
||||
<property name="name" value="MoveRecords" />
|
||||
<property name="permission" value="MoveRecords"/>
|
||||
<property name="undetermined" value="true" />
|
||||
<property name="kind" value="RECORD" />
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<!-- Do we care if it's cutoff or not? -->
|
||||
</map>
|
||||
</property>
|
||||
<property name="targetCapability" ref="rmFileRecordsCapability"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmUpgradeDowngradeAndDeclassifyRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpgradeDowngradeAndDeclassifyRecords"/>
|
||||
<property name="permission" value="UpgradeDowngradeAndDeclassifyRecords"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="name" value="MoveRecords" />
|
||||
<property name="permission" value="MoveRecords"/>
|
||||
<property name="undetermined" value="true" />
|
||||
<property name="kind" value="RECORD" />
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<!-- Do we care if it's cutoff or not? -->
|
||||
</map>
|
||||
</property>
|
||||
<property name="targetCapability" ref="rmFileRecordsCapability"/>
|
||||
<property name="groupId" value="metadataControl"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmReOpenFoldersCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ReOpenFolders"/>
|
||||
<property name="permission" value="ReOpenFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
<bean id="rmUpgradeDowngradeAndDeclassifyRecordsCapability"
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="UpgradeDowngradeAndDeclassifyRecords"/>
|
||||
<property name="permission" value="UpgradeDowngradeAndDeclassifyRecords"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -4,42 +4,42 @@
|
||||
<beans>
|
||||
|
||||
<bean id="rmCloseFoldersCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CloseFolders"/>
|
||||
<property name="permission" value="CloseFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmFolderControlGroup">
|
||||
<property name="name" value="CloseFolders"/>
|
||||
<property name="permission" value="CloseFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyFoldersCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyFolders"/>
|
||||
<property name="permission" value="CreateModifyDestroyFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_CATEGORY</value>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmFolderControlGroup">
|
||||
<property name="name" value="CreateModifyDestroyFolders"/>
|
||||
<property name="permission" value="CreateModifyDestroyFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_CATEGORY</value>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmMoveRecordFolderCapability"
|
||||
@@ -55,4 +55,42 @@
|
||||
<property name="targetCapability" ref="rmCreateModifyDestroyFoldersCapability"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmReOpenFoldersCapability"
|
||||
parent="rmFolderControlGroup">
|
||||
<property name="name" value="ReOpenFolders"/>
|
||||
<property name="permission" value="ReOpenFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeclareRecordsInClosedFoldersCapability"
|
||||
parent="rmFolderControlGroup">
|
||||
<property name="name" value="DeclareRecordsInClosedFolders"/>
|
||||
<property name="permission" value="DeclareRecordsInClosedFolders"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.closed" value="true"/>
|
||||
<entry key="capabilityCondition.declared" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
@@ -0,0 +1,96 @@
|
||||
# Records
|
||||
capability.group.records.title=Records
|
||||
capability.DeclareRecords.title=Declare Records
|
||||
capability.ViewRecords.title=View Records
|
||||
capability.UndeclareRecords.title=Undeclare Records
|
||||
|
||||
# Metadata Control
|
||||
capability.group.metadataControl.title=Metadata Control
|
||||
capability.EditRecordMetadata.title=Edit Record Metadata
|
||||
capability.EditDeclaredRecordMetadata.title=Edit Declared Record Metadata
|
||||
capability.EditNonRecordMetadata.title=Edit Non Record Metadata
|
||||
capability.MoveRecords.title=Move Records
|
||||
|
||||
# Folder Control
|
||||
capability.group.folderControl.title=Folder Control
|
||||
capability.CreateModifyDestroyFolders.title=Create Modify Destroy Folders
|
||||
capability.CloseFolders.title=Close Folders
|
||||
capability.ReOpenFolders.title=Re-Open Folders
|
||||
capability.DeclareRecordsInClosedFolders.title=Declare Records In Closed Folders
|
||||
|
||||
# Vital Records
|
||||
capability.group.vitalRecords.title=Vital Records
|
||||
capability.UpdateVitalRecordCycleInformation.title=Update Vital Record Cycle Information
|
||||
capability.CycleVitalRecords.title=Cycle Vital Records
|
||||
capability.PlanningReviewCycles.title=Planning Review Cycles
|
||||
|
||||
# References and Links
|
||||
capability.group.referencesAndLinks.title=References and Links
|
||||
capability.ChangeOrDeleteReferences.title=Change Or Delete References
|
||||
capability.DeleteLinks.title=Delete Links
|
||||
|
||||
# Events
|
||||
capability.group.events.title=Events
|
||||
capability.CreateModifyDestroyEvents.title=Create Modify Destroy Events
|
||||
capability.AddModifyEventDates.title=Add Modify Event Dates
|
||||
|
||||
# Cutoff
|
||||
capability.group.cutoff.title=Cutoff
|
||||
capability.ApproveRecordsScheduledForCutoff.title=Approve Records Scheduled For Cutoff
|
||||
capability.CreateModifyRecordsInCutoffFolders.title=Create Modify Records In Cutoff Folders
|
||||
|
||||
# Disposition and Transfers
|
||||
capability.group.dispositionAndTransfers.title=Disposition and Transfers
|
||||
capability.UpdateTriggerDates.title=Update Trigger Dates
|
||||
capability.ManuallyChangeDispositionDates.title=Manually Change Disposition Dates
|
||||
capability.AuthorizeNominatedTransfers.title=Authorize Nominated Transfers
|
||||
capability.AuthorizeAllTransfers.title=Authorize All Transfers
|
||||
capability.DestroyRecordsScheduledForDestruction.title=Destroy Records Scheduled For Destruction
|
||||
capability.DestroyRecords.title=Destroy Records
|
||||
capability.DeleteRecords.title=Delete Records
|
||||
capability.TriggerAnEvent.title=Trigger An Event
|
||||
|
||||
# Hold Controls
|
||||
capability.group.holdControls.title=Hold Controls
|
||||
capability.ExtendRetentionPeriodOrFreeze.title=Extend Retention Period Or Freeze
|
||||
capability.Unfreeze.title=Unfreeze
|
||||
capability.ViewUpdateReasonsForFreeze.title=View Update Reasons For Freeze
|
||||
|
||||
# Audit
|
||||
capability.group.audit.title=Audit
|
||||
capability.DeclareAuditAsRecord.title=Declare Audit As Record
|
||||
capability.EnableDisableAuditByTypes.title=Enable Disable Audit By Types
|
||||
capability.DeleteAudit.title=Delete Audit
|
||||
capability.SelectAuditMetadata.title=Select Audit Metadata
|
||||
capability.AccessAudit.title=Access Audit
|
||||
capability.ExportAudit.title=Export Audit
|
||||
|
||||
# Roles and Access Rights
|
||||
capability.group.rolesAndAccessRights.title=Roles and Access Rights
|
||||
capability.CreateModifyDestroyRoles.title=Create Modify Destroy Roles
|
||||
capability.CreateModifyDestroyUsersAndGroups.title=Create Modify Destroy Users And Groups
|
||||
capability.PasswordControl.title=Password Control
|
||||
capability.DisplayRightsReport.title=Display Rights Report
|
||||
capability.ManageAccessControls.title=Manage Access Controls
|
||||
capability.ManageAccessRights.title=Manage Access Rights
|
||||
|
||||
# File Plan Metadata, Lists and Email
|
||||
capability.group.filePlanMetadataListsAndEmail.title=File Plan Metadata, Lists and Email
|
||||
capability.CreateModifyDestroyFileplanMetadata.title=Create Modify Destroy File Plan Metadata
|
||||
capability.CreateModifyDestroyFileplanTypes.title=Create Modify Destroy File Plan Types
|
||||
capability.CreateModifyDestroyRecordTypes.title=Create Modify Destroy Record Types
|
||||
capability.CreateAndAssociateSelectionLists.title=Create And Associate Selection Lists
|
||||
capability.EditSelectionLists.title=Edit Selection Lists
|
||||
capability.CreateModifyDestroyReferenceTypes.title=Create Modify Destroy Reference Types
|
||||
capability.AttachRulesToMetadataProperties.title=Attach Rules To Metadata Properties
|
||||
capability.MakeOptionalParametersMandatory.title=Make Optional Parameters Mandatory
|
||||
capability.MapEmailMetadata.title=Map Email Metadata
|
||||
|
||||
# Classified Records
|
||||
capability.group.classifiedRecords.title=Classified Records
|
||||
capability.UpdateClassificationDates.title=Update Classification Dates
|
||||
capability.CreateModifyDestroyClassificationGuides.title=Create Modify Destroy Classification Guides
|
||||
capability.UpgradeDowngradeAndDeclassifyRecords.title=Upgrade Downgrade And Declassify Records
|
||||
capability.UpdateExemptionCategories.title=Update Exemption Categories
|
||||
capability.MapClassificationGuideMetadata.title=Map Classification Guide Metadata
|
||||
capability.CreateModifyDestroyTimeframes.title=Create Modify Destroy Time frames
|
@@ -80,6 +80,7 @@
|
||||
<value>alfresco.module.org_alfresco_module_rm.messages.records-management-service</value>
|
||||
<value>alfresco.module.org_alfresco_module_rm.messages.action-service</value>
|
||||
<value>alfresco.module.org_alfresco_module_rm.messages.audit-service</value>
|
||||
<value>alfresco.module.org_alfresco_module_rm.messages.capability-service</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
@@ -28,149 +28,225 @@
|
||||
parent="rmBaseCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.declarative.CompositeCapability" />
|
||||
|
||||
<!--
|
||||
<bean id="rmRecordsGroup"
|
||||
abstract="true"
|
||||
parent="FIXME???">
|
||||
<property name="groupId" value="records" />
|
||||
</bean>
|
||||
<bean id="rmMetadataControlGroup"
|
||||
abstract="true"
|
||||
parent="FIXME???">
|
||||
<property name="groupId" value="metadataControl" />
|
||||
</bean>
|
||||
-->
|
||||
<bean id="rmFolderControlGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="folderControl" />
|
||||
</bean>
|
||||
<bean id="rmVitalRecordsGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="vitalRecords" />
|
||||
</bean>
|
||||
<bean id="rmReferencesAndLinksGroup"
|
||||
abstract="true"
|
||||
parent="rmBaseCapability">
|
||||
<property name="groupId" value="referencesAndLinks" />
|
||||
</bean>
|
||||
<bean id="rmEventsGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="events" />
|
||||
</bean>
|
||||
<bean id="rmCutoffGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="cutoff" />
|
||||
</bean>
|
||||
<!--
|
||||
<bean id="rmDispositionAndTransfersGroup"
|
||||
abstract="true"
|
||||
parent="FIXME???">
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
-->
|
||||
<bean id="rmHoldControlsGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="holdControls" />
|
||||
</bean>
|
||||
<bean id="rmAuditGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="audit" />
|
||||
</bean>
|
||||
<bean id="rmRolesAndAccessRightsGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="rolesAndAccessRights" />
|
||||
</bean>
|
||||
<!--
|
||||
<bean id="rmFilePlanMetadataListsAndEmailGroup"
|
||||
abstract="true"
|
||||
parent="FIXME???">
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
-->
|
||||
<bean id="rmClassifiedRecordsGroup"
|
||||
abstract="true"
|
||||
parent="declarativeCapability">
|
||||
<property name="groupId" value="classifiedRecords" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmAddModifyEventDatesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="AddModifyEventDates"/>
|
||||
<property name="permission" value="AddModifyEventDates"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.hasEvents" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmEventsGroup">
|
||||
<property name="name" value="AddModifyEventDates"/>
|
||||
<property name="permission" value="AddModifyEventDates"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.hasEvents" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmAttachRulesToMetadataPropertiesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="AttachRulesToMetadataProperties"/>
|
||||
<property name="permission" value="AttachRulesToMetadataProperties"/>
|
||||
<property name="name" value="AttachRulesToMetadataProperties"/>
|
||||
<property name="permission" value="AttachRulesToMetadataProperties"/>
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmChangeOrDeleteReferencesCapability"
|
||||
parent="rmBaseCapability"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.ChangeOrDeleteReferencesCapability">
|
||||
<property name="name" value="ChangeOrDeleteReferences"/>
|
||||
<property name="permission" value="ChangeOrDeleteReferences"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmReferencesAndLinksGroup"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.ChangeOrDeleteReferencesCapability">
|
||||
<property name="name" value="ChangeOrDeleteReferences"/>
|
||||
<property name="permission" value="ChangeOrDeleteReferences"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyClassificationGuidesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyClassificationGuides"/>
|
||||
<property name="permission" value="CreateModifyDestroyClassificationGuides"/>
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="CreateModifyDestroyClassificationGuides"/>
|
||||
<property name="permission" value="CreateModifyDestroyClassificationGuides"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyEventsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyEvents" />
|
||||
<property name="permission" value="CreateModifyDestroyEvents" />
|
||||
</bean>
|
||||
|
||||
parent="rmEventsGroup">
|
||||
<property name="name" value="CreateModifyDestroyEvents" />
|
||||
<property name="permission" value="CreateModifyDestroyEvents" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyFileplanTypesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyFileplanTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyFileplanTypes" />
|
||||
</bean>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyFileplanTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyFileplanTypes" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyRecordTypesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyRecordTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyRecordTypes" />
|
||||
</bean>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyRecordTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyRecordTypes" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyReferenceTypesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyReferenceTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyReferenceTypes" />
|
||||
</bean>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyReferenceTypes" />
|
||||
<property name="permission" value="CreateModifyDestroyReferenceTypes" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyRolesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyRoles" />
|
||||
<property name="permission" value="CreateModifyDestroyRoles" />
|
||||
</bean>
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="CreateModifyDestroyRoles" />
|
||||
<property name="permission" value="CreateModifyDestroyRoles" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyTimeframesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyTimeframes" />
|
||||
<property name="permission" value="CreateModifyDestroyTimeframes" />
|
||||
</bean>
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="CreateModifyDestroyTimeframes" />
|
||||
<property name="permission" value="CreateModifyDestroyTimeframes" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCreateModifyDestroyUsersAndGroupsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CreateModifyDestroyUsersAndGroups" />
|
||||
<property name="permission" value="CreateModifyDestroyUsersAndGroups" />
|
||||
</bean>
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="CreateModifyDestroyUsersAndGroups" />
|
||||
<property name="permission" value="CreateModifyDestroyUsersAndGroups" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmCycleVitalRecordsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="CycleVitalRecords"/>
|
||||
<property name="permission" value="CycleVitalRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.isTransferring" value="false" />
|
||||
<entry key="capabilityCondition.transferred" value="false"/>
|
||||
<entry key="capabilityCondition.destroyed" value="false"/>
|
||||
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmVitalRecordsGroup">
|
||||
<property name="name" value="CycleVitalRecords"/>
|
||||
<property name="permission" value="CycleVitalRecords"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
|
||||
<entry key="capabilityCondition.isTransferring" value="false" />
|
||||
<entry key="capabilityCondition.transferred" value="false"/>
|
||||
<entry key="capabilityCondition.destroyed" value="false"/>
|
||||
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDeleteLinksCapability"
|
||||
parent="rmBaseCapability"
|
||||
parent="rmReferencesAndLinksGroup"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.DeleteLinksCapability">
|
||||
<property name="name" value="DeleteLinks"/>
|
||||
<property name="permission" value="DeleteLinks"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="name" value="DeleteLinks"/>
|
||||
<property name="permission" value="DeleteLinks"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmDisplayRightsReportCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="DisplayRightsReport" />
|
||||
<property name="permission" value="DisplayRightsReport" />
|
||||
</bean>
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="DisplayRightsReport" />
|
||||
<property name="permission" value="DisplayRightsReport" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmMakeOptionalPropertiesMandatoryCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="MakeOptionalParametersMandatory" />
|
||||
<property name="permission" value="MakeOptionalParametersMandatory" />
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="MakeOptionalParametersMandatory" />
|
||||
<property name="permission" value="MakeOptionalParametersMandatory" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmManageAccessControlsCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="ManageAccessControls" />
|
||||
<property name="permission" value="ManageAccessControls" />
|
||||
</bean>
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="ManageAccessControls" />
|
||||
<property name="permission" value="ManageAccessControls" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmManageAccessRightsCapability"
|
||||
parent="declarativeCapability">
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="ManageAccessRights"/>
|
||||
<property name="permission" value="ManageAccessRights"/>
|
||||
<property name="conditions">
|
||||
@@ -182,88 +258,91 @@
|
||||
</bean>
|
||||
|
||||
<bean id="rmMapClassificationGuideMetadataCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="MapClassificationGuideMetadata" />
|
||||
<property name="permission" value="MapClassificationGuideMetadata" />
|
||||
</bean>
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="MapClassificationGuideMetadata" />
|
||||
<property name="permission" value="MapClassificationGuideMetadata" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmMapEmailMetadataCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="MapEmailMetadata" />
|
||||
<property name="permission" value="MapEmailMetadata" />
|
||||
</bean>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="MapEmailMetadata" />
|
||||
<property name="permission" value="MapEmailMetadata" />
|
||||
<property name="groupId" value="filePlanMetadataListsAndEmail" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmPasswordControlCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="PasswordControl" />
|
||||
<property name="permission" value="PasswordControl" />
|
||||
</bean>
|
||||
parent="rmRolesAndAccessRightsGroup">
|
||||
<property name="name" value="PasswordControl" />
|
||||
<property name="permission" value="PasswordControl" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmPlanningReviewCyclesCapability"
|
||||
parent="declarativeCapability" >
|
||||
<property name="name" value="PlanningReviewCycles"/>
|
||||
<property name="permission" value="PlanningReviewCycles"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmVitalRecordsGroup" >
|
||||
<property name="name" value="PlanningReviewCycles"/>
|
||||
<property name="permission" value="PlanningReviewCycles"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.cutoff" value="false"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rmTriggerAnEventCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="TriggerAnEvent"/>
|
||||
<property name="permission" value="TriggerAnEvent"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.hasEvents" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="TriggerAnEvent"/>
|
||||
<property name="permission" value="TriggerAnEvent"/>
|
||||
<property name="kinds">
|
||||
<list>
|
||||
<value>RECORD_FOLDER</value>
|
||||
<value>RECORD</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.filling" value="true"/>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
<entry key="capabilityCondition.hasEvents" value="true"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmUpdateClassificationDatesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpdateClassificationDates" />
|
||||
<property name="permission" value="UpdateClassificationDates" />
|
||||
</bean>
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="UpdateClassificationDates" />
|
||||
<property name="permission" value="UpdateClassificationDates" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmUpdateExemptionCategoriesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpdateExemptionCategories" />
|
||||
<property name="permission" value="UpdateExemptionCategories" />
|
||||
</bean>
|
||||
parent="rmClassifiedRecordsGroup">
|
||||
<property name="name" value="UpdateExemptionCategories" />
|
||||
<property name="permission" value="UpdateExemptionCategories" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmUpdateTriggerDatesCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpdateTriggerDates"/>
|
||||
<property name="permission" value="UpdateTriggerDates"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpdateTriggerDates"/>
|
||||
<property name="permission" value="UpdateTriggerDates"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="groupId" value="dispositionAndTransfers" />
|
||||
</bean>
|
||||
|
||||
<bean id="rmUpdateVitalRecordCycleInformationCapability"
|
||||
parent="declarativeCapability">
|
||||
<property name="name" value="UpdateVitalRecordCycleInformation"/>
|
||||
<property name="permission" value="UpdateVitalRecordCycleInformation"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
parent="rmVitalRecordsGroup">
|
||||
<property name="name" value="UpdateVitalRecordCycleInformation"/>
|
||||
<property name="permission" value="UpdateVitalRecordCycleInformation"/>
|
||||
<property name="conditions">
|
||||
<map>
|
||||
<entry key="capabilityCondition.frozen" value="false"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Record Folder capabilities -->
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<shortname>Records Management Capabilities</shortname>
|
||||
<description>Get the list of capabilities available to the current user on the given node.</description>
|
||||
<url>/api/node/{store_type}/{store_id}/{id}/capabilities?includeAll={includeAll?}</url>
|
||||
<url>/api/capabilities?includeAll={includeAll?}</url>
|
||||
<url>/api/capabilities?includeAll={includeAll?}&grouped={grouped?}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readonly">required</transaction>
|
||||
|
@@ -1,11 +1,31 @@
|
||||
{
|
||||
"data" :
|
||||
{
|
||||
"capabilities" :
|
||||
[
|
||||
<#list capabilities as capability>
|
||||
"${capability}"<#if capability_has_next>,</#if>
|
||||
</#list>
|
||||
]
|
||||
}
|
||||
"data":
|
||||
{
|
||||
<#if groupedCapabilities??>
|
||||
"groupedCapabilities":
|
||||
[
|
||||
<#assign keys = groupedCapabilities?keys>
|
||||
<#list keys as key>
|
||||
{
|
||||
"${key}":
|
||||
<#assign capabilitiesMap = groupedCapabilities[key]>
|
||||
<#assign capabilitiesKeys = capabilitiesMap?keys>
|
||||
{
|
||||
<#list capabilitiesKeys as capabilitiesKey>
|
||||
"${capabilitiesKey}": "${capabilitiesMap[capabilitiesKey]}"
|
||||
<#if capabilitiesKey_has_next>,</#if>
|
||||
</#list>
|
||||
}
|
||||
}<#if key_has_next>,</#if>
|
||||
</#list>
|
||||
]
|
||||
<#else>
|
||||
"capabilities":
|
||||
[
|
||||
<#list capabilities as capability>
|
||||
"${capability}"<#if capability_has_next>,</#if>
|
||||
</#list>
|
||||
]
|
||||
</#if>
|
||||
}
|
||||
}
|
@@ -27,6 +27,7 @@ import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
@@ -40,313 +41,345 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
public abstract class AbstractCapability extends RMSecurityCommon
|
||||
implements Capability, RecordsManagementModel, RMPermissionModel
|
||||
{
|
||||
/** Logger */
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(AbstractCapability.class);
|
||||
/** Logger */
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(AbstractCapability.class);
|
||||
|
||||
/** RM entry voter */
|
||||
protected RMEntryVoter voter;
|
||||
/** RM entry voter */
|
||||
protected RMEntryVoter voter;
|
||||
|
||||
/** Capability service */
|
||||
protected CapabilityService capabilityService;
|
||||
/** Capability service */
|
||||
protected CapabilityService capabilityService;
|
||||
|
||||
/** Capability name */
|
||||
protected String name;
|
||||
/** Capability name */
|
||||
protected String name;
|
||||
|
||||
/** Capability title and description */
|
||||
protected String title;
|
||||
protected String description;
|
||||
/** Capability title and description */
|
||||
protected String title;
|
||||
protected String description;
|
||||
|
||||
/** Indicates whether this is a private capability or not */
|
||||
protected boolean isPrivate = false;
|
||||
/** Capability group id and title*/
|
||||
protected String groupId;
|
||||
protected String groupTitle;
|
||||
|
||||
/** List of actions */
|
||||
protected List<RecordsManagementAction> actions = new ArrayList<RecordsManagementAction>(1);
|
||||
/** Indicates whether this is a private capability or not */
|
||||
protected boolean isPrivate = false;
|
||||
|
||||
/** Action names */
|
||||
protected List<String> actionNames = new ArrayList<String>(1);
|
||||
/** List of actions */
|
||||
protected List<RecordsManagementAction> actions = new ArrayList<RecordsManagementAction>(1);
|
||||
|
||||
/**
|
||||
* @param voter RM entry voter
|
||||
*/
|
||||
public void setVoter(RMEntryVoter voter)
|
||||
{
|
||||
this.voter = voter;
|
||||
}
|
||||
/** Action names */
|
||||
protected List<String> actionNames = new ArrayList<String>(1);
|
||||
|
||||
/**
|
||||
* @param capabilityService capability service
|
||||
*/
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
this.capabilityService = capabilityService;
|
||||
}
|
||||
/**
|
||||
* @param voter RM entry voter
|
||||
*/
|
||||
public void setVoter(RMEntryVoter voter)
|
||||
{
|
||||
this.voter = voter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
capabilityService.registerCapability(this);
|
||||
}
|
||||
/**
|
||||
* @param capabilityService capability service
|
||||
*/
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
this.capabilityService = capabilityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an action
|
||||
*
|
||||
* @param action
|
||||
*/
|
||||
public void registerAction(RecordsManagementAction action)
|
||||
{
|
||||
this.actions.add(action);
|
||||
this.actionNames.add(action.getName());
|
||||
voter.addProtectedAspects(action.getProtectedAspects());
|
||||
voter.addProtectedProperties(action.getProtectedProperties());
|
||||
}
|
||||
/**
|
||||
* Init method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
capabilityService.registerCapability(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name capability name
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* Registers an action
|
||||
*
|
||||
* @param action
|
||||
*/
|
||||
public void registerAction(RecordsManagementAction action)
|
||||
{
|
||||
this.actions.add(action);
|
||||
this.actionNames.add(action.getName());
|
||||
voter.addProtectedAspects(action.getProtectedAspects());
|
||||
voter.addProtectedProperties(action.getProtectedProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* @param name capability name
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param title capability title
|
||||
*/
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param titleId message id
|
||||
*/
|
||||
public void setTitleId(String titleId)
|
||||
{
|
||||
this.title = I18NUtil.getMessage(titleId);
|
||||
}
|
||||
/**
|
||||
* @param title capability title
|
||||
*/
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getTitle()
|
||||
*/
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getTitle()
|
||||
*/
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
String title = this.title;
|
||||
if (StringUtils.isBlank(title))
|
||||
{
|
||||
title = I18NUtil.getMessage("capability." + getName() + ".title");
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description capability description
|
||||
*/
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
/**
|
||||
* @param description capability description
|
||||
*/
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param descriptionId message id
|
||||
*/
|
||||
public void setDescriptionId(String descriptionId)
|
||||
{
|
||||
this.description = I18NUtil.getMessage(descriptionId);
|
||||
}
|
||||
/**
|
||||
* @param descriptionId message id
|
||||
*/
|
||||
public void setDescriptionId(String descriptionId)
|
||||
{
|
||||
this.description = I18NUtil.getMessage(descriptionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getDescription()
|
||||
*/
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#isPrivate()
|
||||
*/
|
||||
public boolean isPrivate()
|
||||
{
|
||||
return isPrivate;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#isPrivate()
|
||||
*/
|
||||
public boolean isPrivate()
|
||||
{
|
||||
return isPrivate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isPrivate indicates whether the capability is private or not
|
||||
*/
|
||||
public void setPrivate(boolean isPrivate)
|
||||
{
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
/**
|
||||
* @param isPrivate indicates whether the capability is private or not
|
||||
*/
|
||||
public void setPrivate(boolean isPrivate)
|
||||
{
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates the vote to an AccessStatus
|
||||
*
|
||||
* @param vote
|
||||
* @return
|
||||
*/
|
||||
private AccessStatus translate(int vote)
|
||||
{
|
||||
switch (vote)
|
||||
{
|
||||
case AccessDecisionVoter.ACCESS_ABSTAIN:
|
||||
/**
|
||||
* Translates the vote to an AccessStatus
|
||||
*
|
||||
* @param vote
|
||||
* @return
|
||||
*/
|
||||
private AccessStatus translate(int vote)
|
||||
{
|
||||
switch (vote)
|
||||
{
|
||||
case AccessDecisionVoter.ACCESS_ABSTAIN:
|
||||
return AccessStatus.UNDETERMINED;
|
||||
case AccessDecisionVoter.ACCESS_GRANTED:
|
||||
case AccessDecisionVoter.ACCESS_GRANTED:
|
||||
return AccessStatus.ALLOWED;
|
||||
case AccessDecisionVoter.ACCESS_DENIED:
|
||||
case AccessDecisionVoter.ACCESS_DENIED:
|
||||
return AccessStatus.DENIED;
|
||||
default:
|
||||
default:
|
||||
return AccessStatus.UNDETERMINED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
public int checkActionConditionsIfPresent(NodeRef nodeRef)
|
||||
{
|
||||
String prefix = "checkActionConditionsIfPresent" + getName();
|
||||
int result = getTransactionCache(prefix, nodeRef);
|
||||
if (result != NOSET_VALUE)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
public int checkActionConditionsIfPresent(NodeRef nodeRef)
|
||||
{
|
||||
String prefix = "checkActionConditionsIfPresent" + getName();
|
||||
int result = getTransactionCache(prefix, nodeRef);
|
||||
if (result != NOSET_VALUE)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (actions.size() > 0)
|
||||
{
|
||||
for (RecordsManagementAction action : actions)
|
||||
if (actions.size() > 0)
|
||||
{
|
||||
for (RecordsManagementAction action : actions)
|
||||
{
|
||||
if (action.isExecutable(nodeRef, null))
|
||||
{
|
||||
if (action.isExecutable(nodeRef, null))
|
||||
{
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
|
||||
}
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
|
||||
}
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_DENIED);
|
||||
}
|
||||
else
|
||||
{
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_DENIED);
|
||||
}
|
||||
else
|
||||
{
|
||||
return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#hasPermission(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public AccessStatus hasPermission(NodeRef nodeRef)
|
||||
{
|
||||
return translate(hasPermissionRaw(nodeRef));
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#hasPermission(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public AccessStatus hasPermission(NodeRef nodeRef)
|
||||
{
|
||||
return translate(hasPermissionRaw(nodeRef));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the current user has permission on this capability.
|
||||
* <p>
|
||||
* Returns the raw permission value.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return raw permission value
|
||||
*/
|
||||
public int hasPermissionRaw(NodeRef nodeRef)
|
||||
{
|
||||
String prefix = "hasPermissionRaw" + getName();
|
||||
int result = getTransactionCache(prefix, nodeRef);
|
||||
if (result != NOSET_VALUE)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Determines whether the current user has permission on this capability.
|
||||
* <p>
|
||||
* Returns the raw permission value.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return raw permission value
|
||||
*/
|
||||
public int hasPermissionRaw(NodeRef nodeRef)
|
||||
{
|
||||
String prefix = "hasPermissionRaw" + getName();
|
||||
int result = getTransactionCache(prefix, nodeRef);
|
||||
if (result != NOSET_VALUE)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (checkRmRead(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
|
||||
{
|
||||
result = AccessDecisionVoter.ACCESS_DENIED;
|
||||
}
|
||||
else if (checkActionConditionsIfPresent(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
|
||||
{
|
||||
result = AccessDecisionVoter.ACCESS_DENIED;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = hasPermissionImpl(nodeRef);
|
||||
}
|
||||
if (checkRmRead(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
|
||||
{
|
||||
result = AccessDecisionVoter.ACCESS_DENIED;
|
||||
}
|
||||
else if (checkActionConditionsIfPresent(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
|
||||
{
|
||||
result = AccessDecisionVoter.ACCESS_DENIED;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = hasPermissionImpl(nodeRef);
|
||||
}
|
||||
|
||||
return setTransactionCache(prefix, nodeRef, result);
|
||||
}
|
||||
return setTransactionCache(prefix, nodeRef, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default implementation. Override if different behaviour required.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
protected int hasPermissionImpl(NodeRef nodeRef)
|
||||
{
|
||||
return evaluate(nodeRef);
|
||||
}
|
||||
/**
|
||||
* Default implementation. Override if different behaviour required.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
protected int hasPermissionImpl(NodeRef nodeRef)
|
||||
{
|
||||
return evaluate(nodeRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public int evaluate(NodeRef source, NodeRef target)
|
||||
{
|
||||
return AccessDecisionVoter.ACCESS_ABSTAIN;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public int evaluate(NodeRef source, NodeRef target)
|
||||
{
|
||||
return AccessDecisionVoter.ACCESS_ABSTAIN;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActionNames()
|
||||
*/
|
||||
public List<String> getActionNames()
|
||||
{
|
||||
return actionNames;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActionNames()
|
||||
*/
|
||||
public List<String> getActionNames()
|
||||
{
|
||||
return actionNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActions()
|
||||
*/
|
||||
public List<RecordsManagementAction> getActions()
|
||||
{
|
||||
return actions;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActions()
|
||||
*/
|
||||
public List<RecordsManagementAction> getActions()
|
||||
{
|
||||
return actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getGroupId()
|
||||
*/
|
||||
public String getGroupId()
|
||||
{
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
public void setGroupId(String groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getGroupTitle()
|
||||
*/
|
||||
public String getGroupTitle()
|
||||
{
|
||||
String groupTitle = this.groupTitle;
|
||||
if (StringUtils.isBlank(groupTitle))
|
||||
{
|
||||
groupTitle = I18NUtil.getMessage("capability.group." + getGroupId() + ".title");
|
||||
}
|
||||
return groupTitle;
|
||||
}
|
||||
|
||||
public void setGroupTitle(String groupTitle)
|
||||
{
|
||||
this.groupTitle = groupTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
final AbstractCapability other = (AbstractCapability) obj;
|
||||
if (getName() == null)
|
||||
{
|
||||
if (other.getName() != null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
final AbstractCapability other = (AbstractCapability) obj;
|
||||
if (getName() == null)
|
||||
{
|
||||
if (other.getName() != null)
|
||||
return false;
|
||||
}
|
||||
else if (!getName().equals(other.getName()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (!getName().equals(other.getName()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -32,75 +32,89 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
||||
*/
|
||||
public interface Capability
|
||||
{
|
||||
/**
|
||||
* Does this capability apply to this nodeRef?
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
AccessStatus hasPermission(NodeRef nodeRef);
|
||||
/**
|
||||
* Does this capability apply to this nodeRef?
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
AccessStatus hasPermission(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
int hasPermissionRaw(NodeRef nodeRef);
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
int hasPermissionRaw(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Evaluates the capability.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
int evaluate(NodeRef nodeRef);
|
||||
/**
|
||||
* Evaluates the capability.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
*/
|
||||
int evaluate(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Evaluates the capability, taking into account a target.
|
||||
*
|
||||
* @param source source node reference
|
||||
* @param target target node reference
|
||||
* @return int permission value
|
||||
*/
|
||||
int evaluate(NodeRef source, NodeRef target);
|
||||
/**
|
||||
* Evaluates the capability, taking into account a target.
|
||||
*
|
||||
* @param source source node reference
|
||||
* @param target target node reference
|
||||
* @return int permission value
|
||||
*/
|
||||
int evaluate(NodeRef source, NodeRef target);
|
||||
|
||||
/**
|
||||
* Indicates whether this is a private capability or not. Private capabilities are used internally, otherwise
|
||||
* they are made available to the user to assign to roles.
|
||||
*
|
||||
* @return boolean true if private, false otherwise
|
||||
*/
|
||||
boolean isPrivate();
|
||||
/**
|
||||
* Indicates whether this is a private capability or not. Private capabilities are used internally, otherwise
|
||||
* they are made available to the user to assign to roles.
|
||||
*
|
||||
* @return boolean true if private, false otherwise
|
||||
*/
|
||||
boolean isPrivate();
|
||||
|
||||
/**
|
||||
* Get the name of the capability
|
||||
*
|
||||
* @return String capability name
|
||||
*/
|
||||
String getName();
|
||||
/**
|
||||
* Get the name of the capability
|
||||
*
|
||||
* @return String capability name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Get the title of the capability
|
||||
*
|
||||
* @return String capability title
|
||||
*/
|
||||
String getTitle();
|
||||
/**
|
||||
* Get the title of the capability
|
||||
*
|
||||
* @return String capability title
|
||||
*/
|
||||
String getTitle();
|
||||
|
||||
/**
|
||||
* Get the description of the capability
|
||||
*
|
||||
* @return String capability description
|
||||
*/
|
||||
String getDescription();
|
||||
/**
|
||||
* Get the description of the capability
|
||||
*
|
||||
* @return String capability description
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* Get the name of optional actions tied to this capability
|
||||
* @return
|
||||
*/
|
||||
List<String> getActionNames();
|
||||
/**
|
||||
* Get the name of optional actions tied to this capability
|
||||
* @return
|
||||
*/
|
||||
List<String> getActionNames();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<RecordsManagementAction> getActions();
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<RecordsManagementAction> getActions();
|
||||
|
||||
/**
|
||||
* Gets the group id of a capability
|
||||
*
|
||||
* @return String capability group id
|
||||
*/
|
||||
String getGroupId();
|
||||
|
||||
/**
|
||||
* Gets the group title of a capability
|
||||
*
|
||||
* @return String capability group title
|
||||
*/
|
||||
String getGroupTitle();
|
||||
}
|
||||
|
@@ -33,66 +33,74 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
||||
*/
|
||||
public interface CapabilityService
|
||||
{
|
||||
/**
|
||||
* Register a capability
|
||||
*
|
||||
* @param capability capability
|
||||
*/
|
||||
void registerCapability(Capability capability);
|
||||
/**
|
||||
* Register a capability
|
||||
*
|
||||
* @param capability capability
|
||||
*/
|
||||
void registerCapability(Capability capability);
|
||||
|
||||
/**
|
||||
* Get a named capability.
|
||||
*
|
||||
* @param name capability name
|
||||
* @return {@link Capability} capability or null if not found
|
||||
*/
|
||||
Capability getCapability(String name);
|
||||
/**
|
||||
* Get a named capability.
|
||||
*
|
||||
* @param name capability name
|
||||
* @return {@link Capability} capability or null if not found
|
||||
*/
|
||||
Capability getCapability(String name);
|
||||
|
||||
/**
|
||||
* Get a list of all the assignable capabilities.
|
||||
*
|
||||
* @return {@link Set}<{@link Capability}> set of all the assignable capabilities
|
||||
*/
|
||||
Set<Capability> getCapabilities();
|
||||
/**
|
||||
* Get a list of all the assignable capabilities.
|
||||
*
|
||||
* @return {@link Set}<{@link Capability}> set of all the assignable capabilities
|
||||
*/
|
||||
Set<Capability> getCapabilities();
|
||||
|
||||
/**
|
||||
* Get a list of all the capabilities, optionally including those that are non-assignable.
|
||||
*
|
||||
* @param includePrivate indicates that the private, or non-assignable capabilities are included in the result
|
||||
* @return {@link Set}<{@link Capability}> set of capabilities
|
||||
*/
|
||||
Set<Capability> getCapabilities(boolean includePrivate);
|
||||
/**
|
||||
* Get a list of all the capabilities, optionally including those that are non-assignable.
|
||||
*
|
||||
* @param includePrivate indicates that the private, or non-assignable capabilities are included in the result
|
||||
* @return {@link Set}<{@link Capability}> set of capabilities
|
||||
*/
|
||||
Set<Capability> getCapabilities(boolean includePrivate);
|
||||
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user for the assignable capabilities.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef);
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user for the assignable capabilities.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate);
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param capabilityNames
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames);
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param capabilityNames
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames);
|
||||
|
||||
/**
|
||||
* Helper method to get the access state for a single capability.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param capabilityName
|
||||
* @return
|
||||
*/
|
||||
AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName);
|
||||
/**
|
||||
* Helper method to get the access state for a single capability.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param capabilityName
|
||||
* @return
|
||||
*/
|
||||
AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName);
|
||||
|
||||
/**
|
||||
* Gets all the capabilities grouped by their ids. The map key is the group id of a capability and the
|
||||
* value is another map with the key being the capability name and the value being the capability title
|
||||
*
|
||||
* @return Map of capabilities grouped by their ids
|
||||
*/
|
||||
Map<String, Map<String, String>> getGroupedCapabilities();
|
||||
}
|
||||
|
@@ -27,6 +27,8 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* @author Roy Wetherall
|
||||
@@ -34,125 +36,169 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
||||
*/
|
||||
public class CapabilityServiceImpl implements CapabilityService
|
||||
{
|
||||
/** Capabilities */
|
||||
private Map<String, Capability> capabilities = new HashMap<String, Capability>(57);
|
||||
/** Capabilities */
|
||||
private Map<String, Capability> capabilities = new HashMap<String, Capability>(57);
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapability(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Capability getCapability(String name)
|
||||
{
|
||||
return capabilities.get(name);
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapability(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Capability getCapability(String name)
|
||||
{
|
||||
ParameterCheck.mandatoryString("name", name);
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#registerCapability(org.alfresco.module.org_alfresco_module_rm.capability.Capability)
|
||||
*/
|
||||
@Override
|
||||
public void registerCapability(Capability capability)
|
||||
{
|
||||
capabilities.put(capability.getName(), capability);
|
||||
}
|
||||
return capabilities.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities()
|
||||
*/
|
||||
@Override
|
||||
public Set<Capability> getCapabilities()
|
||||
{
|
||||
return getCapabilities(true);
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#registerCapability(org.alfresco.module.org_alfresco_module_rm.capability.Capability)
|
||||
*/
|
||||
@Override
|
||||
public void registerCapability(Capability capability)
|
||||
{
|
||||
ParameterCheck.mandatory("capability", capability);
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities(boolean)
|
||||
*/
|
||||
@Override
|
||||
public Set<Capability> getCapabilities(boolean includePrivate)
|
||||
{
|
||||
Set<Capability> result = null;
|
||||
if (includePrivate == true)
|
||||
{
|
||||
result = new HashSet<Capability>(capabilities.values());
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new HashSet<Capability>(capabilities.size());
|
||||
for (Capability capability : capabilities.values())
|
||||
capabilities.put(capability.getName(), capability);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities()
|
||||
*/
|
||||
@Override
|
||||
public Set<Capability> getCapabilities()
|
||||
{
|
||||
return getCapabilities(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities(boolean)
|
||||
*/
|
||||
@Override
|
||||
public Set<Capability> getCapabilities(boolean includePrivate)
|
||||
{
|
||||
Set<Capability> result = null;
|
||||
if (includePrivate == true)
|
||||
{
|
||||
result = new HashSet<Capability>(capabilities.values());
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new HashSet<Capability>(capabilities.size());
|
||||
for (Capability capability : capabilities.values())
|
||||
{
|
||||
if (capability.isPrivate() == false)
|
||||
{
|
||||
if (capability.isPrivate() == false)
|
||||
{
|
||||
result.add(capability);
|
||||
}
|
||||
result.add(capability);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
|
||||
{
|
||||
return getCapabilitiesAccessState(nodeRef, false);
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
@Override
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
|
||||
{
|
||||
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
|
||||
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
|
||||
for (Capability capability : listOfCapabilites)
|
||||
{
|
||||
return getCapabilitiesAccessState(nodeRef, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
@Override
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
|
||||
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
|
||||
for (Capability capability : listOfCapabilites)
|
||||
{
|
||||
AccessStatus status = capability.hasPermission(nodeRef);
|
||||
if (answer.put(capability, status) != null)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
|
||||
*/
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
ParameterCheck.mandatory("capabilityNames", capabilityNames);
|
||||
|
||||
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
|
||||
for (String capabilityName : capabilityNames)
|
||||
{
|
||||
Capability capability = capabilities.get(capabilityName);
|
||||
if (capability != null)
|
||||
{
|
||||
AccessStatus status = capability.hasPermission(nodeRef);
|
||||
if (answer.put(capability, status) != null)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
|
||||
*/
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
|
||||
{
|
||||
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
|
||||
for (String capabilityName : capabilityNames)
|
||||
{
|
||||
Capability capability = capabilities.get(capabilityName);
|
||||
if (capability != null)
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilityAccessState(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
ParameterCheck.mandatory("capabilityName", capabilityName);
|
||||
|
||||
AccessStatus result = AccessStatus.UNDETERMINED;
|
||||
Capability capability = getCapability(capabilityName);
|
||||
if (capability != null)
|
||||
{
|
||||
List<String> list = Collections.singletonList(capabilityName);
|
||||
Map<Capability, AccessStatus> map = getCapabilitiesAccessState(nodeRef, list);
|
||||
result = map.get(capability);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getGroupedCapabilities()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Map<String, String>> getGroupedCapabilities()
|
||||
{
|
||||
Map<String, Map<String, String>> groupedCapabilities = new HashMap<String, Map<String, String>>(capabilities.size());
|
||||
for (Capability capability : getCapabilities(true))
|
||||
{
|
||||
String groupTitle = capability.getGroupTitle();
|
||||
if (StringUtils.isNotBlank(groupTitle))
|
||||
{
|
||||
String capabilityName = capability.getName();
|
||||
String capabilityTitle = capability.getTitle();
|
||||
|
||||
if (groupedCapabilities.containsKey(groupTitle))
|
||||
{
|
||||
AccessStatus status = capability.hasPermission(nodeRef);
|
||||
if (answer.put(capability, status) != null)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
groupedCapabilities.get(groupTitle).put(capabilityName, capabilityTitle);
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilityAccessState(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
|
||||
{
|
||||
AccessStatus result = AccessStatus.UNDETERMINED;
|
||||
Capability capability = getCapability(capabilityName);
|
||||
if (capability != null)
|
||||
{
|
||||
List<String> list = Collections.singletonList(capabilityName);
|
||||
Map<Capability, AccessStatus> map = getCapabilitiesAccessState(nodeRef, list);
|
||||
result = map.get(capability);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
Map<String, String> capabilityList = new HashMap<String, String>(13);
|
||||
capabilityList.put(capabilityName, capabilityTitle);
|
||||
groupedCapabilities.put(groupTitle, capabilityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return groupedCapabilities;
|
||||
}
|
||||
}
|
||||
|
@@ -42,52 +42,52 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public class RmRolesGet extends DeclarativeWebScript
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(RmRolesGet.class);
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(RmRolesGet.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
}
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
}
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Set<Role> roles = null;
|
||||
@Override
|
||||
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Set<Role> roles = null;
|
||||
|
||||
// TODO should be passed
|
||||
List<NodeRef> roots = rmService.getFilePlans();
|
||||
if (roots != null && roots.size() > 0)
|
||||
{
|
||||
NodeRef root = roots.get(0);
|
||||
// TODO should be passed
|
||||
List<NodeRef> roots = rmService.getFilePlans();
|
||||
if (roots != null && roots.size() > 0)
|
||||
{
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
// Get the user filter
|
||||
String user = req.getParameter("user");
|
||||
if (user != null && user.length() != 0)
|
||||
{
|
||||
roles = rmSecurityService.getRolesByUser(root, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = rmSecurityService.getRoles(root);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = new HashSet<Role>(1);
|
||||
}
|
||||
// Get the user filter
|
||||
String user = req.getParameter("user");
|
||||
if (user != null && user.length() != 0)
|
||||
{
|
||||
roles = rmSecurityService.getRolesByUser(root, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = rmSecurityService.getRoles(root);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = new HashSet<Role>(1);
|
||||
}
|
||||
|
||||
model.put("roles", roles);
|
||||
model.put("roles", roles);
|
||||
|
||||
return model;
|
||||
return model;
|
||||
}
|
||||
}
|
@@ -31,6 +31,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
@@ -39,73 +40,87 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
public class CapabilitiesGet extends DeclarativeWebScript
|
||||
{
|
||||
private RecordsManagementService recordsManagementService;
|
||||
private RecordsManagementService recordsManagementService;
|
||||
|
||||
private CapabilityService capabilityService;
|
||||
private CapabilityService capabilityService;
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
this.capabilityService = capabilityService;
|
||||
}
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
this.capabilityService = capabilityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.web.scripts.content.StreamContent#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
|
||||
String storeType = templateVars.get("store_type");
|
||||
String storeId = templateVars.get("store_id");
|
||||
String nodeId = templateVars.get("id");
|
||||
/**
|
||||
* @see org.alfresco.repo.web.scripts.content.StreamContent#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
|
||||
String storeType = templateVars.get("store_type");
|
||||
String storeId = templateVars.get("store_id");
|
||||
String nodeId = templateVars.get("id");
|
||||
|
||||
boolean includePrivate = false;
|
||||
String includePrivateString = req.getParameter("includeAll");
|
||||
if (includePrivateString != null)
|
||||
{
|
||||
NodeRef nodeRef = null;
|
||||
if (StringUtils.isNotBlank(storeType) && StringUtils.isNotBlank(storeId) && StringUtils.isNotBlank(nodeId))
|
||||
{
|
||||
nodeRef = new NodeRef(new StoreRef(storeType, storeId), nodeId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we are talking about the file plan node
|
||||
// TODO we are making the assumption there is only one file plan here!
|
||||
List<NodeRef> filePlans = recordsManagementService.getFilePlans();
|
||||
if (filePlans.isEmpty() == true)
|
||||
{
|
||||
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No file plan node has been found.");
|
||||
}
|
||||
else if (filePlans.size() != 1)
|
||||
{
|
||||
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "More than one file plan has been found.");
|
||||
}
|
||||
nodeRef = filePlans.get(0);
|
||||
}
|
||||
|
||||
boolean grouped = false;
|
||||
String groupedString = req.getParameter("grouped");
|
||||
if (StringUtils.isNotBlank(groupedString))
|
||||
{
|
||||
grouped = Boolean.parseBoolean(groupedString);
|
||||
}
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>(1);
|
||||
if (grouped == true)
|
||||
{
|
||||
model.put("groupedCapabilities", capabilityService.getGroupedCapabilities());
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean includePrivate = false;
|
||||
String includePrivateString = req.getParameter("includeAll");
|
||||
if (StringUtils.isNotBlank(includePrivateString))
|
||||
{
|
||||
includePrivate = Boolean.parseBoolean(includePrivateString);
|
||||
}
|
||||
}
|
||||
|
||||
NodeRef nodeRef = null;
|
||||
if (storeType != null && storeId != null && nodeId != null)
|
||||
{
|
||||
nodeRef = new NodeRef(new StoreRef(storeType, storeId), nodeId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we are talking about the file plan node
|
||||
// TODO we are making the assumption there is only one file plan here!
|
||||
List<NodeRef> filePlans = recordsManagementService.getFilePlans();
|
||||
if (filePlans.isEmpty() == true)
|
||||
{
|
||||
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No file plan node has been found.");
|
||||
}
|
||||
else if (filePlans.size() != 1)
|
||||
{
|
||||
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "More than one file plan has been found.");
|
||||
}
|
||||
nodeRef = filePlans.get(0);
|
||||
}
|
||||
|
||||
Map<Capability, AccessStatus> map = capabilityService.getCapabilitiesAccessState(nodeRef, includePrivate);
|
||||
List<String> list = new ArrayList<String>(map.size());
|
||||
for (Map.Entry<Capability, AccessStatus> entry : map.entrySet())
|
||||
{
|
||||
Map<Capability, AccessStatus> map = capabilityService.getCapabilitiesAccessState(nodeRef, includePrivate);
|
||||
List<String> list = new ArrayList<String>(map.size());
|
||||
for (Map.Entry<Capability, AccessStatus> entry : map.entrySet())
|
||||
{
|
||||
AccessStatus accessStatus = entry.getValue();
|
||||
if (AccessStatus.DENIED.equals(accessStatus) == false)
|
||||
{
|
||||
Capability capability = entry.getKey();
|
||||
list.add(capability.getName());
|
||||
Capability capability = entry.getKey();
|
||||
list.add(capability.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
model.put("capabilities", list);
|
||||
}
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>(1);
|
||||
model.put("capabilities", list);
|
||||
return model;
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user