11-07-2016 06:40 AM
Hi All,
I am trying to remove access control from document or from folder but action was not done by using remove acl method, kindly see the below source for more detail which i am using to remove acl from file or folder..
Document doc = ((Document)session.GetObject("workspace://SpacesStore/" + ObjectId));
List<String> permissions = new List<String>();
permissions.Add("Consumer");
string AssignEmpName = UserName;
DotCMIS.Data.IAce aceIn = session.ObjectFactory.CreateAce(principal, permissions);
List<IAce> aceListIn = new List<IAce>();
aceListIn.Add(aceIn);
doc.RemoveAcl(aceListIn, DotCMIS.Enums.AclPropagation.ObjectOnly);
doc.ApplyAcl(aceListIn, null, DotCMIS.Enums.AclPropagation.ObjectOnly);
11-07-2016 07:35 AM
RemoveAcl method can only remove direct aces,can't remove inherited aces.
11-07-2016 12:01 PM
Thanks kayne for replying ,
i have another question on above code i had tried above given to remove but still aces are not removed
so how to remove inherited aces and given permission..
Kindly provide your valuable suggestion
Regards,
Shivkumar Swamy
11-07-2016 09:01 PM
Why do you want to remove inherited aces?
you can add some aces to this node to override ancestor's permissions.
If you really want to remove inherited aces ,you need to
1.You can get acl of this node using GetAcl method
2.iterate all aces in the returned acl and find all not direct(indirect ) ace
3.iterate this node's parent and remove indirect ace setted on ancestor.
11-08-2016 12:24 AM
Thank you Kayne !
Actually I am assigning and de-assigning permission from document. so removing permission i am using remove acl.
but aces not removed from document. and i am not removing inherited aces just removing permission given like contributer.
11-08-2016 03:25 AM
It seems it is a bug.
What version of your dotcmis are you using? and which binding are you using? what version of alfresco are you using?
11-08-2016 07:06 AM
Hi Kayne,
i am using latest version 5.0 of alfresco and accessing through atompub api.
using Dotcmis version frameword 3.5 and higher
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub;
parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://server:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/";
parameters[DotCMIS.SessionParameter.User] = UserName;
parameters[DotCMIS.SessionParameter.Password] = Password;
SessionFactory factory = SessionFactory.NewInstance();
ISession session = factory.GetRepositories(parameters)[0].CreateSession();
11-08-2016 09:00 AM
I have tested it on alfresco 5.0 and dotcims 0.7 using both following url
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom
like you said ,RemoveAcl cann't remove aces correctly.
I'm also not sure now whether it is a bug of dotcmis or of alfresco.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.