You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Victor Romanyuk <vr...@elilink.com> on 2012/03/05 17:15:02 UTC

Parsing exception when applying ACL

Hi.
Please, help me with the following issue.
I'm using Alfresco 4.0 and developing .Net application that uses DotCMIS
library. 

Existing Access Control List(ACL) that is applied to the particular folder
is returned fine. The issue appeared when I tried to apply new ACL to a
folder. When I tried it threw "Parsing exception!" exception.

 Here are my C# code lines:

IOperationContext operationContext = Session.CreateOperationContext();
            operationContext.IncludeAcls = true;
            Dictionary<String, object> newFolderProps = new
Dictionary<String, object>();
            newFolderProps.Add(PropertyIds.ObjectTypeId, "cmis:folder");
            newFolderProps.Add(PropertyIds.Name, "ADGFolderPermissions");
            IList<IAce> acl = new List<IAce>();
            var newAce =(Ace) Session.ObjectFactory.CreateAce("admin", new
List<string>() { "cmis:write" });
            acl.Add(newAce);
            Folder folderAssociations =
(Folder)Session.GetRootFolder().CreateFolder(newFolderProps, null, acl,
null, operationContext );
            
            var createdFolderwithOC = (Folder)
Session.GetObject(folderAssociations.Id, operationContext);

            createdFolderwithOC.AddAcl(acl, AclPropagation.ObjectOnly);



Last line causes exception "Parsing exception!". What am I doing wrong?
Does anyone have suggestions on that?

 

Thank you.

Regards, Victor


Re: Parsing exception when applying ACL

Posted by Florian Müller <fm...@apache.org>.
Hi Victor,

Please provide a few more details.
What URL you are using to connect to Alfresco? Could you send us a stack trace?


Thanks,

Florian


> Hi.
> Please, help me with the following issue.
> I'm using Alfresco 4.0 and developing .Net application that uses DotCMIS
> library.
> 
> Existing Access Control List(ACL) that is applied to the particular folder
> is returned fine. The issue appeared when I tried to apply new ACL to a
> folder. When I tried it threw "Parsing exception!" exception.
> 
>   Here are my C# code lines:
> 
> IOperationContext operationContext = Session.CreateOperationContext();
>              operationContext.IncludeAcls = true;
>              Dictionary<String, object>  newFolderProps = new
> Dictionary<String, object>();
>              newFolderProps.Add(PropertyIds.ObjectTypeId, "cmis:folder");
>              newFolderProps.Add(PropertyIds.Name, "ADGFolderPermissions");
>              IList<IAce>  acl = new List<IAce>();
>              var newAce =(Ace) Session.ObjectFactory.CreateAce("admin", new
> List<string>() { "cmis:write" });
>              acl.Add(newAce);
>              Folder folderAssociations =
> (Folder)Session.GetRootFolder().CreateFolder(newFolderProps, null, acl,
> null, operationContext );
> 
>              var createdFolderwithOC = (Folder)
> Session.GetObject(folderAssociations.Id, operationContext);
> 
>              createdFolderwithOC.AddAcl(acl, AclPropagation.ObjectOnly);
> 
> 
> 
> Last line causes exception "Parsing exception!". What am I doing wrong?
> Does anyone have suggestions on that?
> 
> 
> 
> Thank you.
> 
> Regards, Victor
> 
>