-
Notifications
You must be signed in to change notification settings - Fork 216
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
Cache error #171
Comments
This is my first time using this package and I just found this same issue. I had to customize and override some models and traits to fit my needs, but I can't figure out what's happening here. In summary I am using something like this in my controller (I am just playing around with this package):
I'm using L5.3 and, as I said, I did some changes, so I can use Roles with string ID fields. The thing here is about the dd function response which return false right after the role assignation to the logged user. I changed "cacheMinutes" variable in the acl.php config file but I get the same result. I also try not using cache to get the user roles (overwriting this portion of code in my custom trait from hasRole trait):
Once again, no luck with this change, I get exactly the same behavior if I ask if the logged user has the role right after the role assignation. The strange thing here is that if I make a new request to the same controller or any other controller with this last change, the So... where is that roles info comming from? Can you use new roles and permissions just after the cache info expires? Am I missing something? How can I use the role or ask for it right after the assignation? |
Method |
Sorry, I am looking by |
Ok, I am here to clarify that my problem is not a package issue at all. I found that this is an expected behavior from the laravel Auth facade and its guard (/Illuminate/Auth/Guard.php). The Auth::user() and its relations are locked (by locked I mean cached) under the same request. Unless you use Auth::user()->fresh() to fetch your user data you not gonna see any change made. |
@felorodri @IlyaSavich |
Yes, I think, but I'm understanding how to update the package to apply this changes ? What version ? |
ok, thanks )
2016-11-25 19:36 GMT+03:00 Quentin Pétel <[email protected]>:
… My commits have not been merged yet. You could use my fork :
https://github.com/QuentinPetel/laravel-acl
ex with composer : "repositories": [
{
"type": "vcs",
"url": "https://github.com/QuentinPetel/laravel-acl"
}
],
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL7_5N6B3umU7ynwvdd90JsWpJBH3XgFks5rBw6KgaJpZM4K1r9g>
.
|
Good day. I try yo update roles for user. Updating works well, but after updating I have a problem that method
getRoles()
returns previous state. I tried to change'cacheMinutes' => 1,
to0
ornull
, but got the same result. Can you help me?The text was updated successfully, but these errors were encountered: