-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Granular CLP pointer permissions #6352
Granular CLP pointer permissions #6352
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6352 +/- ##
==========================================
+ Coverage 93.83% 93.83% +<.01%
==========================================
Files 169 169
Lines 11588 11654 +66
==========================================
+ Hits 10874 10936 +62
- Misses 714 718 +4
Continue to review full report at Codecov.
|
Could you explain why? It is related to this recent issue. |
I've replied in that issue, in brief:
There is no object on server before it is created. And obviously no field of that object with If we allow create by field (pointer permission) examining just the incoming object from POST body - I believe this adds zero security, but more importantly it would then allow anyone to create an object, just by putting himself into a field. If you want to enforce a rule that some field should contain only the person who creates it - this has nothing to do with class level permissions. Create operation can be allowed using CLP of any other type (role, user pointer, requiresAuthentication) but not using a Pointer Permission (column name).
As of now (without this PR) there can't be a separate addField pointer permission ( now it is part of writeUserField group in contrary to non-pointer perms that already allow granularity). My PR adds ability to set pointer permission per operation. Since addField is not a separate REST operation, but rather a side effect of create/update request But when updating - there is already an object so it's possible to permit/deny based on pointer permission column. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This is great work! Thank you! Is there a change in the parse-dashboard project needed? |
* set pointer permissions per operatioon; tests * more tests * fixes addField permission; tests
Yes, it's needed. I left a comment here. Thanks. |
From this comment: [objectId]: true, // by id of `_User` How does that work? Thanks. |
Tracking issue #6351
Previously requested with #4251, #4045
Pointer permissions for:
create
has no effectaddField
accounted only on updating object, ignored when creatingWhen set for an operation: