-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[PROPOSAL] Add a Default User Role #3153
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
Comments
You can use a pointer permission in the CLP for that, the Pointer Permission would be read write for the user column and read only for the other. There is also that PR that adds logged in user as a CLP: #893 |
Awesome, so we will see this in 2.3.0! Cheers |
#893 has been merged, and I believe this will address your scenarios right? |
ping @benishak |
I have a scenario that can not be implemented in current parse-server. If there is a default User Role like @benishak described, it could be worked. Private Account like Instagram scenario: Here is my assuming implementation using parse-server:
Then if user turn the Private Account on, we can just remove User Role from Follower Role. On the other hand, if your turn the Private Account off, we just add User Role back to Follower Role. |
Not sure why you need that, there is now the requireAuthentication CLP, which basically let you restrict access to only logged in users. |
@flovilmart There is a feature called Private Account. If any user turn this on, his/her photos will be queried only if the request is from his/her followers. There is a workaround way currently, ACL of all photos from one user are public read while Private Account is OFF. If Private Account is ON, disable all photos public read and set read access for a Role called 'followersOf(userId)' contained all followers of this user. The cons of this workaround is we need to fetch all photos from this user while he / she switch Private Account ON/OFF, and change these photos' ACL. Ps. It could not be done by the requireAuthentication CLP, because it should affect just some specific users' photos, not all objects in Photo class. |
the default User Role would not solve it either. I understand what you're trying to achieve, let me think of something. |
|
Is there a way to have a User Role by default ?
Imagine you have a class called Activities and you want to let only logged in to Users create objects in that class but only the user himself can delete or update his/her own object that he/she created.
The issue here we have to allow the (Public Create) in the CLP, which makes everybody can add a new entry in the class, but thanks to ACL only the user can delete or update his/her object, which is fine.
Expected Behavior:
User
create objectWorkaround for now
User
and add a relation that add all users from the User classThis is only example, this can apply for any other operation such
delete
Here example with
delete
operation that doesn't work cause of CLP when Public Delete is not checkedobject.destroy()
orobject.delete()
while CLP Public Delete is not allowedworkaround in this case
Parse.Cloud.useMasterKey()
<- Bad idea!deleteObject
which take theobjectId
andclassName
of the objectThe text was updated successfully, but these errors were encountered: