The aim is to hide buttons like "Add content" and "Add row" for these users, to limit the functionality around content creation to standard admin users.
Has anyone done anything like this before, or have any ideas on how to achieve this?
This is the sort of thing i was thinking I could use razor syntax in an Umbraco template and it can check groups and apply the relevant CSS styling?
@{
var currentUserGroups = umbraco.library.GetCurrentMemberGroups();
var customCssFileName = "";
// Check user's group membership
if (currentUserGroups.Contains("Group1"))
{
customCssFileName = "custom-group1.css";
}
else if (currentUserGroups.Contains("Group2"))
{
customCssFileName = "custom-group2.css";
}
// Add more conditions for additional groups if needed
// Load the custom CSS file
if (!string.IsNullOrEmpty(customCssFileName))
{
<link rel="stylesheet" type="text/css" href="~/css/@customCssFileName" />
}
}
Apply custom css to admin groups
Firstly hi to the community, as this is my first post having recently joined the world of Umbraco.
I have this issue where I want to hide some elements of the backend to some of the admin users.
The scenario is - If an Umbraco user is not in the group "Administrators" I want to apply a simple bit of css (a bit like this)
The aim is to hide buttons like "Add content" and "Add row" for these users, to limit the functionality around content creation to standard admin users.
Has anyone done anything like this before, or have any ideas on how to achieve this?
This is the sort of thing i was thinking I could use razor syntax in an Umbraco template and it can check groups and apply the relevant CSS styling?
is working on a reply...