Hi Sergiy ,
I manage to make it work:
For the Signup Service
// include an acl parameter in the Signup Service
// include this code in the Before Send Event Mapping ind the js for the acl parameter
//admin_ID is the _id of the Administrator System User. You can get it when you make the login of the system
//set read and write permissions for the Administrator
var acl = {};
//set Admin user permission
acl[admin_ID] = {
"read": true,
"write": true
};
acl['*'] = {
"read": true
};
return acl; // return the acl to the service with the admin_ID set with an permission so we can later update the record.
As a response we get the new created user ID ( _id)
Save this ID in a localStorage Variable.
Then create an updateUserService and update only the acl parameter in the user record.
For the updateUserService you created
//Put the bellow js code in the acl paramater in the Before Send Event of the update service Mapping
//Map the resource_ID localStorage to the acl parameter.
var acl = {};
//set resource_ID permission
acl[value] = {
"read": true,
"write": true
};
//set Admin user permission. Include the logged admin user _id admin_ID
acl[admin_ID] = {
"read": true,
"write": true
};
acl['*'] = {
"read": true
};
return acl;
I am still testing this. So if I find any problem I will return to the subject.