I'm creating a certain doctype via API... Is there anyway I can set member permissions on that as it's created? Or someway I can set member permissions on *all* instances of that doctype somewhere in umbraco? Or..?
foreach(Document doc in Document.GetGetDocumentsOfDocumentType(1234)) { if(!Access.IsProtected(doc.Id, doc.Path)) { Access.ProtectPage(false, doc.Id, 5678, 5678); // Last two params are the login and error page Access.AddMembershipRoleToDocument(doc.Id, doc.Text); } }
Setting member permissions via API
Hi,
I'm creating a certain doctype via API... Is there anyway I can set member permissions on that as it's created? Or someway I can set member permissions on *all* instances of that doctype somewhere in umbraco? Or..?
Cheers,
Hi Paul,
How about something like:
? :-)
Let me know what you think.
- Bo
is working on a reply...