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 ?
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.
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 ?
Hi!
Looking at the the documentation it looks like this is not exposed in the ”resource”-service: https://our.umbraco.com/apidocs/v7/ui/#/api/umbraco.resources.usersResource
But creating your own controller is quite straight forward, in your controller you could probably use the UserService and get the groups: https://our.umbraco.com/apidocs/v7/csharp/api/Umbraco.Core.Services.UserService.html
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.
is working on a reply...