Zayaa
06/14/2024, 11:50 AMAbradolf Lincler
06/14/2024, 12:34 PMcsharp @using Umbraco.Cms.Core.Security
@using Umbraco.Cms.Web.Common.PublishedModels;
@using Umbraco.Docs.PropertyEditors
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<MySuggestionsModel>
@inject IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@{
Layout = null;
}
<div>
@* Check for others properties here and tailor them to your needs *@
@if (_backOfficeSecurityAccessor.BackOfficeSecurity.CurrentUser.IsAdmin())
@Model.Suggestion
</div>
First from the top of my head is just injecting BackOfficeService to your view and simply check if user is in the permitted group.
I guess you can achive the same in the backoffice as well. Somehow access the user context in your angularJs code. Probablly you have to refer to documentation.Abradolf Lincler
06/14/2024, 1:08 PMauthResource.getCurrentUser()
.then(function(data) {
//Do stuff for fetching the current logged in Umbraco backoffice user
});
This should have information about user's groups and roles.Zayaa
06/14/2024, 2:04 PMMatt Wise
06/15/2024, 1:06 PMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by