chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller (JIRA) <j...@apache.org>
Subject [jira] [Assigned] (CMIS-645) ACL is not applied when a document\folder is being created
Date Tue, 16 Apr 2013 13:29:15 GMT

     [ https://issues.apache.org/jira/browse/CMIS-645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Florian Müller reassigned CMIS-645:
-----------------------------------

    Assignee: Florian Müller
    
> ACL is not applied when a document\folder is being created
> ----------------------------------------------------------
>
>                 Key: CMIS-645
>                 URL: https://issues.apache.org/jira/browse/CMIS-645
>             Project: Chemistry
>          Issue Type: Bug
>          Components: dotcmis
>            Reporter: Denis Andreev
>            Assignee: Florian Müller
>            Priority: Critical
>
> There is an issue with ACL applying when a document or folder is being created. 
> The code below does not work:
> IDocument cmisDoc = folder.CreateDocument(properties, contentStream, null, null, cmisAces,
null, new OperationContext() { IncludeAcls = true });
> cmisDoc.Acl does not contain provided ACEs.
> But after that :
> cmisDoc.ApplyAcl(cmisAces, null, AclPropagation.RepositoryDetermined);
> It does.
> I looked into the code and found out that the method DotCMIS.Binding.AtomPub.ObjectService.HandleAclModifications()
seems to be working in a wrong way.
> The condition in the code below “if (originalAces != null)” is always false. If I
comment it then it works.
>         private void HandleAclModifications(String repositoryId, AtomEntry entry, IAcl
addAces, IAcl removeAces)
>         {
>            if (!IsAclMergeRequired(addAces, removeAces))
>             {
>                 return;
>             }
>             IAcl originalAces = null;
>             // walk through the entry and find the current ACL
>             foreach (AtomElement element in entry.GetElements())
>             {
>                 if (element.Object is cmisObjectType)
>                 {
>                     // extract current ACL
>                     cmisObjectType cmisObject = (cmisObjectType)element.Object;
>                     originalAces = Converter.Convert(cmisObject.acl, cmisObject.exactACLSpecified
? (bool?)cmisObject.exactACL : null);
>                     break;
>                 }
>             }
>             if (originalAces != null)
>             {
>                 // merge and update ACL
>                 IAcl newACL = MergeAcls(originalAces, addAces, removeAces);
>                 if (newACL != null)
>                 {
>                     UpdateAcl(repositoryId, entry.Id, newACL, null);
>                 }
>             }
>         }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message