Base solution for your next web application
Open Closed

AbpPermission #1423


User avatar
0
guzhenglongguojun created

Hi,Thamk you very much,Firstly. Why not Set 'TenantId' in the table of 'AbpPermission',because i want to search the user depend the 'Permission'.I look for the source code,I found the code only search the permission depend on 'userid' or 'roleid' ,So your design?


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

    Hi,

    AbpPermissions table contains TenantId field. It will be filled for tenants, it's only null for host.

    TenantId field is checked by dynamic filters, you dont have to worry about it. If you want to saerch users by their permisison, it's a bit complicated query, we have done it in the latest release of AspNet Zero (v1.11.0).

    You need to join your query with RolePermissionSetting, UserPermissionSetting and UserRole. Then you need to check respectively if a permission is granted to user in UserPermissionSetting, RolePermissionSetting or by default.

    I hope this helps you. As I said it's a bit compicated.