Add membergroup to node programmatically - Umbraco 7
Hello!
I'm struggling with programmatically adding 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 e) { foreach (var content in e.SavedEntities) { if (content != null && content.ContentType.Alias == "Unitpage") { var service = new MemberGroupService(new RepositoryFactory());
Add membergroup to node programmatically - Umbraco 7
Hello!
I'm struggling with programmatically adding 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:
Best,
jesper
is working on a reply...