-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Fix RBAC upload permissions #10484
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
Fix RBAC upload permissions #10484
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10484 +/- ##
=======================================
Coverage 58.06% 58.06%
=======================================
Files 185 185
Lines 6434 6434
Branches 1399 1399
=======================================
Hits 3736 3736
Misses 2235 2235
Partials 463 463
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
What does it do?
Fix an issue where setting permissions with conditions on the assets for the upload plugin can break the permissions checks.
In a previous PR, the auto-populate for the fetch has been removed, which caused the
created_byattribute to be raw instead of populated, hence causing an issue when fetching the associated role.As a fix, we simply use the raw identifier (from the
created_byfield) instead of trying to access theidproperty inside.Another idea would've been to fetch directly the whole user based on the
created_byid, but it would mean fetching also unwanted properties for the user, such as password & co.Why is it needed?
Upload plugin's assets permissions are not working as they should.
How to test it?
See: #10452 ("Steps to reproduce this issue")
Related issue(s)/PR(s)
introduced by #10370
fix #10452