Open Closed

No support for localising role names? #6493


User avatar
0
LW created
  • ABP Framework version: v7.3.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Separated

One of our tenant wants to have roles with a different language. We tried to do this by changing the role names in that tenant's database, leaving the normalised name intact. We need to leave the normalised name intact so we can still seed role permissions normally. This did not work, however, because permission grants reference the role table with the role name, not the normalised name or id. Why is that, and can this be changed, in order to support the role name localisation?


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

    hi

    This may be because no normalized role name or id is stored in current claims.

    You can change this but the framework does not consider changing it because this will bring huge breaking changes.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RolePermissionValueProvider.cs#L47 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js#L40

  • User Avatar
    0
    LW created

    Ok, how about customizing the roles page so it would use the normalised name as localisation key. Then in that tenant, the role names could be visualised in a different language. Is this something we could easily do by just replacing the one page or do we need to pull the whole identity pro module to our sources?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can add DisplayName to the IdentityRole. and show it on UI. This will be easy.

  • User Avatar
    0
    LW created

    Please clarify how. Do you mean adding the DisplayName as extra property? Will the display name already by visible in the UI or do we still need to create the custom page?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can add it by extra property or download and customise the source code.

    then override the default UI to show the displayname instead of name.

  • User Avatar
    0
    LW created

    Still not clear enough for me, sorry :) Can we "override the default UI to show the displayname instead of name" , without downloading and customising the source code.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Yes.

    See: https://support.abp.io/QA/Questions/160/How-to-customize-an-ABP-project https://docs.abp.io/en/abp/latest/UI/Angular/Component-Replacement

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