Base solution for your next web application
Open Closed

Organization units permission/filter #3505


User avatar
0
robrechtbelien created

Hi,

What would be the best way to achieve the following?

When an admin (or another custom role name) user is in a specific OU he or she should only be able to create/edit/view users from that OU or child OU's. Also I have a couple of other entity's that are linked to users. I only want these users to get the records for users in the same or child OU's.

I'm using the .net core with jquery version. on the full framework.

Regards, Robrecht


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

    Hi,

    You can override ApplyFilters method in your RepositoryBase, see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Domain/Repositories/AbpRepositoryBase.cs#L263">https://github.com/aspnetboilerplate/as ... se.cs#L263</a> and apply organization unit filter after current filters in the cases you like.

    You can use IMayHaveOrganizationUnit or IMustHaveOrganizationUnit interfaces for that purpose. They are defined in Abp.Zero.Common nuget package but not used anywhere.

    Thanks.