0
deepak created
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
YourProjectNamePermissionDefinitionProvider
in .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); } } }
- Go to your