Base solution for your next web application
Open Closed

Permission Checker #6058


User avatar
0
tugrulkarakaya created

My API client has a permission on Host side. (Permission is just for Host not for tenants) but if I change Current Tenant ID the permission checker return the client does not have permission? See code below.

using (CurrentUnitOfWork.SetTenantId(input.TenantId)) { if (!PermissionChecker.IsGranted(AppPermissions.ApiClient_BroadcastList_Edit)) { throw new AbpAuthorizationException("You are not authorized to create user!"); } ... ...

if I check permisson before setting tenant it works (passes the control) Permission is added as multiTenancySides: MultiTenancySides.Host

Any way to do this except changin permission from "host" to "host and clients".

there are workarounds like changing tenant in the sub method etc. but I find it strange that permisson is checked according to current selected Tenant


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

    Hi @tugrulkarakaya

    I'm not sure how the complete method looks like but if you want to check a host permission, then you need to be on host context.