1 Answer(s)
-
0
Hi @deepak
We designed permissions to be kept in a Dictionary. Unfortunately dictionaries in C# aren't designed for being able to be sorted. https://stackoverflow.com/a/7521383/7200126
We can consider adding an order to permissions but currently, there is no order in permission groups.
I can show you a workaround until we'll add that feature.
- Go to your
YourProjectNamePermissionDefinitionProviderin .Application.Contracts project and make a manual ordering like below.
public override void Define(IPermissionDefinitionContext context) { // some other permission additions of your app // ... if (context is PermissionDefinitionContext definitionContext) { var ordered = definitionContext.Groups.OrderByDescending(...).ToList(); definitionContext.Groups.Clear(); foreach (var item in ordered) { definitionContext.Groups.Add(item.Key, item.Value); } } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Go to your
