Open Closed

Blazor Server: Error when trying to edit role permissions #6422


User avatar
0
tech37 created
  • ABP Framework version: v8.0.0

  • UI Type: Blazor Server

  • Database System: EF Core (SQL Server

    • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:

  • [2023-12-31T11:54:03.626Z] Error: System.Collections.Generic.KeyNotFoundException: The given key 'SettingManagement.Emailing.Test' was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Volo.Abp.PermissionManagement.Blazor.Components.PermissionManagementModal.<>c__DisplayClass42_1.

  • Steps to reproduce the issue:

  • When clicking on Identity Management -> Roles (admin role) -> Edit Role permissions i get a server error with the above in both the VS console and http debugger on the browser.

  • I tried creating a new role as well and tried to edit permissions and received the same issue.

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

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will confirm and fix this. Your question credits refunded.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    We can't reproduce this error in the 8.0 startup template.

    Can you share a simple project? liming.ma@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    I can reproduce the problem. we will fix it. https://github.com/abpframework/abp/pull/18681

    you can try this:

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(PermissionManagementModal))]
    public class MyPermissionManagementModal : PermissionManagementModal
    {
        protected override void SetPermissionDepths(List<PermissionGrantInfoDto> permissions, string currentParent, int currentDepth)
        {
            foreach (var permission in permissions)
            {
                if(permission.Name == "SettingManagement.Emailing.Test")
                {
                {
                    _permissionDepths[permission.Name] = 0;
                }}
            }
            base.SetPermissionDepths(permissions, currentParent, currentDepth);
        }
    }
    
    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 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.