Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bezmundo 48 posts 139 karma points
    May 23, 2015 @ 14:07
    Bezmundo
    0

    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.

  • Sebastiaan Janssen 5046 posts 15479 karma points MVP admin hq
    May 25, 2015 @ 14:23
    Sebastiaan Janssen
    0

    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.

  • Sebastiaan Janssen 5046 posts 15479 karma points MVP admin hq
    May 25, 2015 @ 14:26
    Sebastiaan Janssen
    0
  • Bezmundo 48 posts 139 karma points
    May 25, 2015 @ 23:42
    Bezmundo
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft