Open Closed

Access Denied to Settings Management for Tenant on 4.3.2 #1424


User avatar
0
learnabp created

Hi, I just upgraded to ABP Commercial 4.3.2 and created a new solution called Acme.BookStore and then created a new tenant

when i try and go to settings under Administration i get the following error

can you please let me know what the issue is the admin has access to the settings in the permissions


8 Answer(s)
  • User Avatar
    0
    learnabp created

    I think it is a bug becuase it is trying to access the Email Settings tab for the tenant and since the tenant doesn't have access to the Email Settings it is giving "Access Denied"

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    HI,

    Can you provide steps to reproduce?

  • User Avatar
    0
    learnabp created
    1. Update tools to 4.3.2
    2. run command abp new Acme.BookStore
    3. Open solution file
    4. Run *.DbMigrator and then run the solution with *.Web project as startup project
    5. Login as admin
    6. Create a Tenant Test
    7. Logout
    8. Switch Tenant to new tenant Test
    9. Try and navigate to settings under Administration menu
    10. You will be redirected to Access Denied Page
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Thanks. I will check it out.

  • User Avatar
    0
    learnabp created

    i think thia line is cauaing the problem for a tenant becuase the emailsetting should only be avalabile to the hist right ?

    modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs

            Configure<RazorPagesOptions>(options =>
            {
                options.Conventions.AuthorizePage("/SettingManagement/Index", SettingManagementPermissions.Emailing);
            });
    
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    This is a bug, I will fixed it. by the way, ticket refunded : )

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    For now, try:

    public override void PostConfigureServices(ServiceConfigurationContext context)
    {
        Configure<RazorPagesOptions>(options =>
        {
            options.Conventions.RemoveAll(x =>
            {
                if (x == null)
                {
                    return false;
                }
                var type = x.GetType();
    
                if (type.Name != "PageApplicationModelConvention")
                {
                    return false;
                }
    
                return type.GetField("_path", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(x)
                    .As<string>() == "/SettingManagement/Index";
            });
        });
    }
    
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/pull/9213

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11