Hi,
been looking into creating a customer data type in Umbraco 7 that will allow the user to select from a radio list to control public access permissions.
I have built the simple angularjs data type controller but I'm stuck in trying to check the value selected in the radio list to then change the public access value when the user saves and publish the node.
I guess I could change the control to a boolean to simplify the check of the radio list value but I can't seem to find away with Umbraco.Content.Services to change the node permissions.
If anyone could point me in the right direction or offer any advice to the best way to do this either via surface or webapi controller it would be greatly appreciated.
It was just a request from a client to help minify the process of having to select the member group etc from the process. Usually we would just protect the parent node so it would apply to children nodes but the pages they wanted to protect are certain blogs pages which is why they have to manually do this for each item they want to protect.
Simplify Public Access with data type
Hi, been looking into creating a customer data type in Umbraco 7 that will allow the user to select from a radio list to control public access permissions.
I have built the simple angularjs data type controller but I'm stuck in trying to check the value selected in the radio list to then change the public access value when the user saves and publish the node.
I guess I could change the control to a boolean to simplify the check of the radio list value but I can't seem to find away with Umbraco.Content.Services to change the node permissions.
If anyone could point me in the right direction or offer any advice to the best way to do this either via surface or webapi controller it would be greatly appreciated.
Thanks in advance for your time and efforts.
Any reason you can't just give user access to the right-click > protect page menu item?
Anyway, we don't have any new APIs for this, so when you protect a page it happens in legacy code: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/umbraco.cms/businesslogic/web/Access.cs#L272
You could call this method or create your own little helper class that updates
~/App_Data/access.config
.Note: you'll also need to update the cache if you do this manually: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs#L233
It was just a request from a client to help minify the process of having to select the member group etc from the process. Usually we would just protect the parent node so it would apply to children nodes but the pages they wanted to protect are certain blogs pages which is why they have to manually do this for each item they want to protect.
Thanks for pointing me in the right direction
is working on a reply...