How to update Role based Permissions when a doc is saved
I am using Umbraco 7.2.8. When a new Document of a specific type is saved, I am hooking into the ContentService.Saved event and I want to be able to set the Public Access to only allow a specific member group access to it. Just like I would do using the Gui here.
which both allow me to pass in a list of userIds users that have access but I am interested in setting the membership groups that have access as well as the Login Page and Error Page. How can I do this?
How to update Role based Permissions when a doc is saved
I am using Umbraco 7.2.8. When a new Document of a specific type is saved, I am hooking into the ContentService.Saved event and I want to be able to set the Public Access to only allow a specific member group access to it. Just like I would do using the Gui here.
I see in the documentation here https://our.umbraco.org/documentation/Reference/Management/Services/ContentService There are a couple methods like
.AssignContentPermission(IContent content, char permission, IEnumerable userIds)
and
ReplaceContentPermissions(EntityPermissionSet permissionSet)
which both allow me to pass in a list of userIds users that have access but I am interested in setting the membership groups that have access as well as the Login Page and Error Page. How can I do this?
Got this answered on Stackoverflow here
is working on a reply...