Super Admin Cannot Access Users Across All Teams When Using Teams Feature #2839
Unanswered
YazidKHALDI
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team,
First of all, thank you for maintaining this great package. 🙏
I'm using the teams feature to scope users and their roles/permissions by
company_id( team_id)
. The default behavior works well for regular users — they can only see or manage resources (users, roles, permissions) within their assigned company.However, the issue arises when trying to implement Super Admin functionality.
The Problem
As a Super Admin, I need to be able to:
But the current implementation of
Spatie\laravel-permission
scopes all role/permission data to a single team at a time using:This causes two key issues:
User::with('roles')
returns no roles for users not linked to the current$companyId
.For example:
What I Tried
What Would Be Ideal
As a super admin, I should be able to:
thank you all
Beta Was this translation helpful? Give feedback.
All reactions