Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last version assignRole() bug with loaded roles #2810

Open
scippio opened this issue Feb 21, 2025 · 2 comments
Open

Last version assignRole() bug with loaded roles #2810

scippio opened this issue Feb 21, 2025 · 2 comments

Comments

@scippio
Copy link

scippio commented Feb 21, 2025

Description

Hi I have a problem with last version 6.15.0.

I have environment with central db + tenants (https://tenancyforlaravel.com).
$user = ..
inTenant($tenant, function () use ($user){
setPermissionsTeamId(1);
$permissions = .... (factory)
$user->asignRole(...); <- there is a problem...

//---
after assign, the user have this role and I can continue with my test. But after upgrading to 6.15.0 there is no this role in user->roles (is in tenant db, that's ok).
//---

})

(I have my own load('roles') method in User, when I parent::load('roles') in tenant and outOfTenant(fn()) I loading central roles and merge it... but I don't think it's related... everything works as it should before 6.15.0. .. )

Steps To Reproduce

...

Example Application

No response

Version of spatie/laravel-permission package:

6.15.0

Version of laravel/framework package:

11.43.2

PHP version:

8.3.6

Database engine and version:

No response

OS: Windows/Mac/Linux version:

No response

@parallels999
Copy link
Contributor

parallels999 commented Feb 21, 2025

In my opinion it was not a bug, just a convenience change

@drbyte
Copy link
Collaborator

drbyte commented Mar 1, 2025

A breaking test that reveals the problem is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants