简体   繁体   中英

Laravel Voyager Admin - How to set permission to access only data of particular user role to him instead of all data

I have four types of users role ie

  1. Super Admin
  2. Sub Admin
  3. Vendor
  4. Customer ( End Users)

So everything was fine I created the multiple masters and Role and Permission modules were working fine. But I am stuck in a case when the Vendor login to the admin dashboard he is able to see the other user's data as well.

TEST CASE: Let's suppose a case:

Each vendor added his services from his account and it's inserted in Service masters and the admin can view all services list of all vendors. Now Browse, Read, Add, Edit, Delete is something that I can handle from Role & Permission modules but Once the vendor login to the admin portal is is also able to see the services on all other vendors.

Query: Now the actual thing I want is once the Vendor login to his dashboard he should be able to view his services list only instead of showing all vendor's services.

在此处输入图像描述

Multi-tenant applications are where you create a single application that is used independently by many different clients. When a client authenticates with your application, they are only able to access the data that they have created in your application and cannot see any data that was created by any of your other clients.

I hope this is what you want to do.

In this case this is simple. You have to use multitenancy.

I cant post the link here, but you can search on devdojo: How to apply multi-tenancy in Laravel Voyager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM