Open Closed

Roles: Existing Role Edit Modal Is Displayed When Clicking the New Role Button #10854


User avatar
0
douwm created

We are encountering the following abnormality and want to confirm if this is a known bug in ABP 9.2:

Description:

After opening and closing the Claims modal for an existing role, clicking the New Role button opens the previously accessed Edit Role modal instead of displaying a blank form for creating a new role.

Steps to Reproduce:

Navigate to Administration > Identity Management > Roles. Select an existing role and open the Claims modal. Close the Claims modal. Click the New Role button. Observe the modal that is displayed.

Actual Result: The previously accessed Edit Role modal is opened when the New Role button is clicked.

Expected Result: Clicking the New Role button should open a blank Create New Role form/modal, without displaying data from any previously selected role.

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
    maliming created
    Support Team Fullstack Developer

    Hi,

    This is a bug in the Roles page of the Angular Identity module.

    You can override the toolbar action until the fix ships. Add this file to your app:

    // src/app/identity-toolbar-contributors.ts
    import { ToolbarAction, ToolbarActionList } from '@abp/ng.components/extensible';
    import { IdentityRoleDto } from '@volo/abp.ng.identity/proxy';
    import {
      eIdentityComponents,
      IdentityToolbarActionContributors,
      RolesComponent,
    } from '@volo/abp.ng.identity';
    
    export const identityToolbarActionContributors: IdentityToolbarActionContributors = {
      [eIdentityComponents.Roles]: [
        (actionList: ToolbarActionList<IdentityRoleDto[]>) => {
          const newRoleNode = actionList.find(
            node => (node.value as ToolbarAction<IdentityRoleDto[]>).text === 'AbpIdentity::NewRole',
          );
    
          if (newRoleNode) {
            actionList.dropByValue(newRoleNode.value);
          }
    
          actionList.addHead(
            ToolbarAction.create<IdentityRoleDto[]>({
              text: 'AbpIdentity::NewRole',
              icon: 'fa fa-plus',
              permission: 'AbpIdentity.Roles.Create',
              action: data => {
                const component = data.getInjected(RolesComponent);
                component.selected = null as unknown as IdentityRoleDto;
                component.onAdd();
              },
            }),
          );
        },
      ],
    };
    

    Then pass it where you register the identity routes in app-routing.module.ts:

    {
      path: 'identity',
      loadChildren: () =>
        import('@volo/abp.ng.identity').then(m =>
          m.IdentityModule.forLazy({
            toolbarActionContributors: identityToolbarActionContributors,
          }),
        ),
    },
    

    We'll fix this in the next release. Your ticket has been refunded.

    Thanks

    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 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.