Stephen Koford
Posts: 0
Joined: Tue Mar 11, 2014 3:49 pm

Modify user (account) information from user interface

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

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Modify user (account) information from user interface

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Modify user (account) information from user interface

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.

Stephen Koford
Posts: 0
Joined: Tue Mar 11, 2014 3:49 pm

Modify user (account) information from user interface

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?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Modify user (account) information from user interface

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

Stephen Koford
Posts: 0
Joined: Tue Mar 11, 2014 3:49 pm

Modify user (account) information from user interface

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

Return to “Issues”