You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
If teams feature is enabled I'd expect to only see member of the team in the result.
Additional context
I think this is the result of inverse whereHas constraint. Team id is in the query SQL, but it's in the subquery, so NOT EXISTS(__subquery__ ... team_id = 1) which "matches" all users. I guess it's how eloquent does it, but it's counter-intuitive with teams feature enabled.
Environment (please complete the following information, because it helps us investigate better):
OS: macos
Version Sonoma
The text was updated successfully, but these errors were encountered:
You need to have your own relationship between user and team This package does not provide you with that part, you must implement it
Fair enough, just that Users::permission() (and hence withoutPermission) includes the team id in the query, it's just that the way the query is constructed make the former look like it works in team scope and the latter doesn't. Anyway, thanks for the suggestion, I can overwrite the trait scope to tack on that extra whereHas constraint to make it work for my app.
Describe the bug
Applying
withoutPermission
scope fromHasPermissions
trait returns users from outside the team.Versions
You can use
composer show
to get the version numbers of:PHP version: 8.2
Database version: MySQL 8.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If teams feature is enabled I'd expect to only see member of the team in the result.
Additional context
I think this is the result of inverse
whereHas
constraint. Team id is in the query SQL, but it's in the subquery, soNOT EXISTS(__subquery__ ... team_id = 1)
which "matches" all users. I guess it's how eloquent does it, but it's counter-intuitive with teams feature enabled.Environment (please complete the following information, because it helps us investigate better):
The text was updated successfully, but these errors were encountered: