Copied to clipboard

Flag this post as spam?

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

  • MB 108 posts 397 karma points
    May 16, 2019 @ 21:31

    BackOffice - Get current user's groups ?

    I need to allow a plug-in to adjust content based on whether the user is an admin, editor, etc.

    Using the BackOffice API (is that the official name?) I can see how to get the current user, but can't see how to get their group memberships, short of creating an UmbracoAuthorizedJsonController and a resource promise to call it.

    Anyone know if there is a direct BackOffice API call for this, or do I need to do the controller/resource thing ?

  • Markus Johansson 1773 posts 5184 karma points c-trib
    May 17, 2019 @ 05:36
    Markus Johansson


    Looking at the the documentation it looks like this is not exposed in the ”resource”-service:

    But creating your own controller is quite straight forward, in your controller you could probably use the UserService and get the groups:

  • MB 108 posts 397 karma points
    May 17, 2019 @ 06:18

    Thanks, and yeah, that's what I'd figured - not exposed by the BackOffice API.

    I've written a number of AuthorisedJsonControllers before, so that's not a drama for me - and I'll go that way seeing as there's no client API for it - just would be less work if there was already something in the client API I could call.

Please Sign in or register to post replies

Write your reply to: