Comments (3)
Just as a follow up:
in my case indeed it was our own fault:
Everytime when Switching a tenant, we run an action "MakeTenantCurrent" and inside of this we called the
`app()->make(PermissionRegistrar::class)->forgetCachedPermissions();``
finally this was the reason why it always loaded all permissions.
Due to our setup I'm not sure how to proceed with that, because this indeed has it's usecase: users can be part of multiple tenants in our setup and are allowed to switch between their tenants, and finally we allow all tenants to define their own roles - many of them use the same setup but in the end they differ in small permission-sets. We would somehow have to cache the permissions per tenant and user...
For now we stick with the current situation postponing it to a time, when our amount of tenants raise...
If somebody has a good solution for such a setup - you're welcome.
from laravel-permission.
this can be easily reproduced by just using teams, and creating roles per teams and finally using for example laravel-debugbar to see how many role-models are loaded
I did try laravel-debugbar, and I couldn't reproduce the problem, It only loads the roles of the logged user-team
Maybe you are not using cache feature
Also, instead of using so many roles per team, you should use global roles.
#2444
from laravel-permission.
Same issue with the TenancyForLaravel package
from laravel-permission.
Related Issues (20)
- Timestamps in migration for sql server HOT 4
- Target class [Spatie\Permission\Middlewares\PermissionMiddleware] does not exist. HOT 2
- DOCS - Side menu dissapeared HOT 4
- Problem upgrading with existing data permissions/roles HOT 1
- Cannot save the user model twice in the same request HOT 10
- withoutPermission scope from HasPermissions returns users from outside the team HOT 3
- Laravel 11 compatibility issues HOT 5
- Problem with middleware definition method in the controller in Laravel 11
- Problem with denied access using the middleware aliases role, permission, and role_or_permission in Spatie Permission version 6 and higher. HOT 2
- Problem when trying to migrate laravel-permission migrations HOT 2
- Docs are not uptodate with current implementation HOT 9
- Diffs are not properly displayed in generated docs HOT 4
- Bug @can OR $user->can OR $user->hasAnyPermission($permission) HOT 1
- Problems giving permissions to a role when the id field is a uuid type HOT 4
- Can't define "Super User" for each guard
- Custom user menu item not being translated HOT 1
- Fix PHPStan failure: Access to an undefined property Illuminate\Database\Eloquent\Model::$name.
- Issue while using Cache+SQlite Laravel 11 HOT 5
- Permissions and Role Disapper(empty) from Model after ~10-14 requests HOT 7
- Unable to Install Package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-permission.