Base solution for your next web application
Open Closed

Unhandled exception on host users not having the "Editions" permission #6210


User avatar
0
kimoerum created

Hi,

ASP:NET ZERO version 6.4.0.0 - on Core and using MVC. Working on the HOST.

I am adding a new role where there is no permission to see the Editions entity. After that, a usere is created and included in this new role only.

When I try to log in as the new user I get this exception:

When I add "Editions" to the role permissions, it works perfect. But I don't want the "Editions" for this role, and don't think I should get an exception on that.

Be also aware that I made no changes to persmissions at all - they are as they come out of the "box". Just in case that should have anything to do with the cause to the problem.

How to solve this issue?

Thanks in advance.


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @kimoerum

    EditionsController.cs has an [AbpMvcAuthorize(AppPermissions.Pages_Editions)] attribute and it requires logged in user to have AppPermissions.Pages_Editions permisison. So, you need to give AppPermissions.Pages_Editions permission to the newly created role.

    You can't see Ediitons page without doing that.

  • User Avatar
    0
    kimoerum created

    HI @ismcagdas,

    you misread my explanation, as my goal for that role is precisely that I donĀ“t want to see the Editions at all!

    And this creates an exception!

  • User Avatar
    0
    aaron created
    Support Team

    TenantsController.Index calls _editionAppService.GetEditionComboboxItems.

    If you don't want to see the Editions at all, don't visit that page.

  • User Avatar
    0
    kimoerum created

    The role dos have Tenants but should not see the Editions or be able to change it on the tenant.

    The exception occures when the page loads - so I don't even try to visit the Editions page!

    In other words, I have a role that can see Tenants, but should not see the Editions.

    That combination should at least not end up in an Exception!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Created an issue here https://github.com/aspnetzero/aspnet-zero-core/issues/2059, please follow it.

  • User Avatar
    0
    kimoerum created

    Reopend by mistake.