Open Closed

Customize Permission Management Modal in Blazor #2441


User avatar
0
balessi75 created

Abp 4.4.3 Commercial (Enterprise) / Blazor Server / EF

Hello, We need to customize the ordering of permission groups in the permission management modal. We used the following document as a reference... https://docs.abp.io/en/abp/4.4/UI/Blazor/Customization-Overriding-Components

Under ...Blazor\Components in our solution, we created a MyPermissionManagmentModal.razor and MyPermissionManagementModal.razor.cs file. We then copied the corresponding source from... https://github.com/abpframework/abp/tree/rel-4.4/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components into our razor and razor code-behind file.

Our MyPermissionManagementModal inherits from Abp's PermissionManagmentModal and we decorated our Modal with... [ExposeServices(typeof(PermissionManagementModal))] [Dependency(ReplaceServices = true)]

At runtime, we can see that a breakpoint is hit in the constructor of MyPermissionManagementModal which is good, however, when we click to open the modal, we receive the following... An internal error occurred during your request! 2022-01-18 16:21:58.742 -05:00 [ERR] Delegate to an instance method cannot have null 'this'. System.ArgumentException: Delegate to an instance method cannot have null 'this'. at System.MulticastDelegate.ThrowNullThisInDelegateToInstance() at Volo.Abp.PermissionManagement.Blazor.Components.PermissionManagementModal.OpenAsync(String providerName, String providerKey, String entityDisplayName)

A break point in our modal at OpenAsync never gets hit.

We are at a loss as to where to go from here and are wondering if we are attempting to solve this problem in an incorrect way. Any help would be greatly appreciated.

Thank you!


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

    hi

    Please share your MyPermissionManagmentModal.razor and MyPermissionManagementModal.razor.cs

    liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I will refactor PermissionManagmentModal to make it replaceable(virtual).

    You can now copy the source code of the Volo.Abp.PermissionManagement.Blazor project into your project.

  • User Avatar
    0
    balessi75 created

    Ok, so the refactoring will be in a future release?

    Can you clarify on what source code to copy and to where/how?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can copy https://github.com/abpframework/abp/tree/dev/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor https://github.com/abpframework/abp/tree/dev/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.Server to your project instead of using the package.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 18, 2024, 05:54