Page 2 of 2

Modify user (account) information from user interface

Posted: Tue Mar 25, 2014 3:25 pm
by Stephen Koford

Gladly :)

This is one method I've tried.
Image

This is a second method I've tried with mapping and modifying the value with JS. Image

Image


Modify user (account) information from user interface

Posted: Tue Mar 25, 2014 7:28 pm
by Nikita

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}}';


Modify user (account) information from user interface

Posted: Wed Mar 26, 2014 3:43 am
by Alena Prykhodko

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.

Image

Instead you have to change "acl" field in the user collection in the db.
Image

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.


Modify user (account) information from user interface

Posted: Wed Mar 26, 2014 3:31 pm
by Stephen Koford

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:
Image
/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?


Modify user (account) information from user interface

Posted: Thu Mar 27, 2014 12:28 am
by Igor

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...


Modify user (account) information from user interface

Posted: Mon Jul 20, 2020 6:46 pm
by Stephen Koford

\""write\"":true}}""} It should have worked but for some reason still did not."