Copied to clipboard

Flag this post as spam?

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


  • Simon Yohannes 58 posts 188 karma points
    Sep 01, 2018 @ 15:39
    Simon Yohannes
    0

    umbraco 7.12 adding user to custom section

    in umbraco 7.12 the User section has had a little update and you no longer get tick boxes to allow you to choose which sections you want a user to have access to. how would you go about giving a user permission to access a custom section in this new layout?

    i also notice that UserService.AddSectionToAllUsers("sectionAlias") is no longer part of the API.

    is there any documentation on custom sections in light of these new changes?

    Thanks

  • Kevin Jump 2319 posts 14774 karma points MVP 8x c-trib
    Sep 01, 2018 @ 18:04
    Kevin Jump
    102

    Hi Simon,

    I am not sure if there is any documentation updates for this - but with the advent of the user groups, you add the section to the AllowedSections list on a group - the below will add a custom section to the admin group (post v7.7):

       private void AddSectionSevenSeven(string alias)
            {
                var adminGroup = _userService.GetUserGroupByAlias("admin");
                if (adminGroup != null)
                {
                    if (!adminGroup.AllowedSections.Contains(alias))
                    {
                        adminGroup.AddAllowedSection(alias);
                        _userService.Save(adminGroup);
                    }
                }
            }
    
  • Simon Yohannes 58 posts 188 karma points
    Sep 02, 2018 @ 12:56
    Simon Yohannes
    0

    thanks so much Kevin, this is exactly what i was looking for

Please Sign in or register to post replies

Write your reply to:

Draft