Open Closed

Create a Permission that is not visible in permission Management #7550


User avatar
0
Spospisil created
  • ABP Framework version: v7.3.3
  • UI Type: Blazor WASM
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Is it possible to create a tenant permission that is not visible in the permission management ui? I want to create a permission for a specific tenant facing page, but don't want the tenant to ever be able to see/change the value of that permission.

Thanks.


4 Answer(s)
  • User Avatar
    0
    Spospisil created

    Hi,

    For example it would be helpful to have a 'IsVisibleToClients' property on the PermissionDefinition object (such as the case with Features) that allows the creation/use of a permission without showing it in the Permission Management UI.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    For example it would be helpful to have a 'IsVisibleToClients' property on the PermissionDefinition object (such as the case with Features) that allows the creation/use of a permission without showing it in the Permission Management UI.

    you can use WithProperty

    myGroup.AddPermission(
        "BookStore_Author_Create",
        LocalizableString.Create<BookStoreResource>("Permission:BookStore_Author_Create")
    ).WithProperty("IsVisibleToClients", ...);
    

  • User Avatar
    0
    Spospisil created

    Hi,

    And defining the permission in this way will prevent it from showing as an option in the permission management UI?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    You need to custom the permission management UI https://github.com/abpframework/abp/blob/dev/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09