-
Notifications
You must be signed in to change notification settings - Fork 235
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
Problem with permission ID caching #227
Comments
Seems to be related to #224 Isn't the master branch the current stable and tested branch? |
You are correct in the actual state you can't create and assign a permission in the same request. The 2.5-stable branch is update to v2.5.14 (latest version) |
#230 is merged, it should fixed now 😄 |
Issue closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
first of all thank you for your work on this library. But I have a serious problem with Aauth's permission caching.
The Situation
I use Aauth to add a bunch of new permissions by running something like this:
After that I want to assign these permissions to the default role. Therefore I am using the following code:
The Problem
Aauth does not save these group-permission relations in the database. On investigation I found that Aauth caches all permission IDs in
$this->cache_perm_id
in the construction method.I thought that running
$this->aauth->get_perm($permission)
to just get the permission ID would work but it also tries to get the permission ID from the cache.So I can't create a permission and assign it to a group in the same request?!
I am not sure if I miss something but there is no method to rebuild the cache or something similar and there is no mention of any caching in the documentation.
In the moment that would mean I have to re-initialize Aauth just to access the permissions that are already saved in the database?
My suggestion would be to at least add a param for the
get_perm($permission)
method to force a database query for the given permission.The text was updated successfully, but these errors were encountered: