Gladly ![]()
This is one method I've tried.
This is a second method I've tried with mapping and modifying the value with JS.
Hello,
Mapping parameters should be passed as strings, not as objects. Let's try to replace:
return {value:{"read":true, "write":true}};
to
return '{"' + value + '":{"read":true, "write":true}}';
Dear Stephen.
It's important to understand how ACL works. Please read more about it here: http://docs.appery.io/documentation/b...
You don't need to send 'acl' field when update user.
Instead you have to change "acl" field in the user collection in the db.
You can replace this field with:
pre
{"*":{"read":true, "write": true}};/pre
It means that any one can modify this row.
If you want to add write permitions only to certain user you should add this user to row 'acl' field.
pre
{
"*": {
"read": true
},
"52fe2adae4b0a25c11c899fd": {
"read": true,
"write": true
},
"52fe2ad1e4b0a25c11c899f8": {
"read": true,
"write": true
}
}
/pre
Which means:
1 All users can read this row.
2 "52fe2adae4b0a25c11c899fd" user(owner) can read and write this row.
3 "52fe2ad1e4b0a25c11c899f8" user(admin) can read and write this row.
Thank you for going over the use and function of the ACL again. I have a fair grasp on it already and I made sure to more-fully understand it before posting this question.
Interestingly enough, the documentation you linked to says
preSet up the service as you would for an object update:
In the Request tab, you need to add the X-Appery-Session-Token (which you get upon login), and the ACL field with the type of object:
/pre
Does this not mean that I can send the ACL with a request in order to update it from the app interface instead of having to do it manually on the database side? I realize I don't emneed to /emsend the ACL but couldn't I do that anyway in order to update it dynamically?
There are three ways how to change acl column automatically:
1 Add update user service request "acl" field(user should be logged in and has permissions to do this).
2 Add "acl" request field when creating(sign in) a user. (it does not required any extra permissions. All created users would have this acl).
3 Using server code and access to collection with "X-Appery-Master-Key".
See details here: http://docs.appery.io/documentation/b...
\""write\"":true}}""} It should have worked but for some reason still did not."