Skip to content

Instantly share code, notes, and snippets.

@jcdcdev
Created August 22, 2023 21:59
Show Gist options
  • Save jcdcdev/d20514ba55fd23e7ae2d87c588e27712 to your computer and use it in GitHub Desktop.
Save jcdcdev/d20514ba55fd23e7ae2d87c588e27712 to your computer and use it in GitHub Desktop.
Umbraco.Community.SimpleDashboards - Example #3
using Umbraco.Community.SimpleDashboards.Core;
// Control order of where dashboard shows
[Umbraco.Cms.Core.Composing.Weight(-100)]
public class BasicDashboard : SimpleDashboard
{
public BasicDashboard()
{
// Set dashboard name
SetName("Example Dashboard Name (default)");
// Set culture specific dashboard name
SetName("Example Dashboard Name (en-GB)", "en-GB");
// Show dashboard in the Media & Content sections
AddSection(Cms.Core.Constants.Applications.Media);
AddSection(Cms.Core.Constants.Applications.Content);
// Allow Editors
AddAccessRule(SimpleAccessRule.AllowEditorGroup);
// Allow custom User Group
Allow(x=>x.UserGroup("myGroup"));
// Deny custom User Group
Deny(x=>x.UserGroup("myOtherGroup"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment