How can I programmatically add a membergroup to a node?
I'm creating a membergroup if a page of a certain contenttype is created, hooking on to the Saved event. Then I want to add that membergroup to the current node to set access rights.
Any ideas on how to do this? This is my code so far:
private void ContentService_Saved(IContentService sender, SaveEventArgs<IContent> e) { foreach (var content in e.SavedEntities) { if (content != null && content.ContentType.Alias == "Unitpage") { var service = new MemberGroupService(new RepositoryFactory());
Add membergroup to node in code - Umbraco 7
Hello!
How can I programmatically add a membergroup to a node?
I'm creating a membergroup if a page of a certain contenttype is created, hooking on to the Saved event. Then I want to add that membergroup to the current node to set access rights.
Any ideas on how to do this? This is my code so far:
is working on a reply...