how to update property of user using -me- ?

Showing results for 
Search instead for 
Did you mean: 
Active Member

how to update property of user using -me- ?

public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {"inside Execute method ");
ServiceResponseDTO responseObject = new ServiceResponseDTO();
String message = req.getParameter(MESSAGE);;
NodeRef node = serviceRegistry.getPersonService().getPerson("-me-");"node is " + node);
if(node!= null) {
serviceRegistry.getNodeService().setProperty(node, USER_EMAIL_STATUS, message);
responseObject.setMessage("Property update for node ");
} else {
responseObject.setMessage("Node is not there ");
res.getWriter().write(new ObjectMapper().writeValueAsString(responseObject));


<bean id="webscript.customer.user-update.get"
class="com.UserUpdate" parent="webscript">
<property name="serviceRegistry">
<ref bean="ServiceRegistry" />

<shortname>User Update</shortname>
<description> User Update</description>
<format default="json"></format>

this is working for admin but not working for other user 

    "status": {
        "code": 500,
        "name": "Internal Error",
        "description": "An error inside the HTTP server which prevented it from fulfilling the request."
    "message": "06171445 Access Denied.  You do not have the appropriate permissions to perform this operation.",
    "exception": "",
    "callstack": [],
    "server": "Enterprise v5.2.3 (r852994b1-b12) schema 10,065",
    "time": "Jul 17, 2019 12:10:52 PM"
4 Replies
Senior Member II

Re: how to update property of user using -me- ?

Can you add some more details "-me-" is something which is confusing.Are you trying to get current logged in user?If that is so this is not the ppropriate method.Can you add the requirement for webscript as well?

Active Member

Re: how to update property of user using -me- ?

-me- means current logged in user  so I am updating property of  logged in user

Senior Member II

Re: how to update property of user using -me- ?

Below is the code for getting current logged in user name.


Try to run the update code using transaction management and run that particular code as admin/system user.

Alfresco Employee

Re: how to update property of user using -me- ?

JFYI: The moniker "-me-" relates to remote public REST API:!/people/getPerson