Open Closed

Sorting in Permission Management #3088


User avatar
0
deepak created
  • ABP Framework version: 4.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Is that possible to sort the Permission Management module (Left Menu)? Can we set User created module first and than Identity and so on?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    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);
            }
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.