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
Custom permissions not working after update from rc94 to rc96 #8794
Comments
This: {
"group": {
"users": {
"user": {
"_eq": "$CURRENT_USER"
},
"role": {
"_eq": "author"
}
}
}
} should be this: {
"_and": [
{
"group": {
"users": {
"user": {
"_eq": "$CURRENT_USER"
}
}
}
},
{
"group": {
"users": {
"role": {
"_eq": "author"
}
}
}
}
]
} the first example should be correct |
Thanks, tried this, but for some reason I am now getting duplicate results. In the collection view |
Correction, I am getting duplicate results on a different filter:
Both of these statements are true, thats probably why there are duplicates? |
It seems the
BUT THIS DOES NOT WORK. |
Hey. I have almost the same behavior:
This is what I set to DB I am using v9.0.0-rc.98 |
I think is not supported, because it's a dynamic value. |
This comment has been minimized.
This comment has been minimized.
This happens in the application because the value " directus/app/src/interfaces/_system/system-filter/input-component.vue Lines 114 to 115 in 9f163ce
|
there should be option for adding filter either through filter interface or through writing filter code. or Filter interface should have option for dynamic fields like current_user and current_role. I am not able to filter items based on current user because filter interface is not allowing current_user dynamic field. |
@mdjabeer4u click the field label and use "Raw Value". Works for fields all over the app 👍🏻 |
did not realize that's a button. thanks. |
Hello @u12206050 Also @valdeirpsr, directus/app/src/interfaces/_system/system-filter/input-component.vue Lines 114 to 115 in c298942
I am going to close it for now, but if you think this is still an issue we can reopen. |
Preflight Checklist
Describe the Bug
So after updating to rc96 and running migrations non admin users can not update items as the previously could.
It seems custom permissions are being parsed different now than before.
The following is a very common filter rule I use on a lot of my collections and it used to work on rc94.
I even have a more advanced one that also used to work be it only on update but not on create:
To Reproduce
Setup a
groups
collection that has a many to many relationship todirectus_users
calledusers
Note, I called the foreign column
user
Optionally to test with a role and a string field called
role
to the pivot tableSetup a different collection such as
registrations
with a M2O relationship withgroups
Add users to groups and attach a group to a registration.
Create a role with the permissions above on the registrations Update and View
Now login with a user that has that role and try viewing and updating a registration.
What version of Directus are you using?
9.0.0-rc.96
What version of Node.js are you using?
16.4.0
What database are you using?
mysql
What browser are you using?
chrome
What operating system are you using?
osx
How are you deploying Directus?
Locally
The text was updated successfully, but these errors were encountered: