Coder Social home page Coder Social logo

Comments (3)

renky avatar renky commented on August 16, 2024 1

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.

parallels999 avatar parallels999 commented on August 16, 2024

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

image

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.

hsmfawaz avatar hsmfawaz commented on August 16, 2024

Same issue with the TenancyForLaravel package

image
image

from laravel-permission.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.