RM-1649 : (Access denied to Declare Record to Unfiled Records for user with Create Records capability)

- I handled the case when the destination folder is not a record folder and the user doesn't need File Record capability to create a record there
   - I wrote a unit test for it but the test is failing with access denied on calling hasAspect method 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@92359 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ana Bozianu
2014-12-16 10:11:09 +00:00
parent 6cb0e1b253
commit b60a6fa4e9
2 changed files with 63 additions and 1 deletions

View File

@@ -121,13 +121,21 @@ public class CreateCapability extends DeclarativeCapability
conditions.put("capabilityCondition.closed", Boolean.FALSE);
conditions.put("capabilityCondition.cutoff", Boolean.FALSE);
// if the destination folder is not a record folder and the user has filling capability on it, grant access to create the record
if (checkConditions(destination, conditions) &&
!recordFolderService.isRecordFolder(destination) )
{
return AccessDecisionVoter.ACCESS_GRANTED;
}
if (checkConditions(destination, conditions) &&
recordFolderService.isRecordFolder(destination) &&
permissionService.hasPermission(destination, RMPermissionModel.FILE_RECORDS) == AccessStatus.ALLOWED)
{
return AccessDecisionVoter.ACCESS_GRANTED;
}
conditions.put("capabilityCondition.closed", Boolean.TRUE);
if (checkConditions(destination, conditions) &&
recordFolderService.isRecordFolder(destination) &&