I'm working with user properties in Sakai and I wish that through some Tool I'm developing a Teacher can alter some properties according to some criteria. I've selected the function user.upd.any in the Realm Role configuration but I keep getting the following error when I try to change the User:
org.sakaiproject.user.api.UserPermissionException user=d1dbdfee-d247-44e4-b5c2-d3d787c829ca function=user.upd.any resource=/user/115cf182-17b0-4f2c-a8fc-34fcbe98bac7
at org.sakaiproject.user.impl.BaseUserDirectoryService.unlock(BaseUserDirectoryService.java:270)
at org.sakaiproject.user.impl.BaseUserDirectoryService.editUser(BaseUserDirectoryService.java:1085)
This is the code that generates the stacktrace:
UserEdit ue = userDirectoryService.editUser(userId);
ue.getProperties().addProperty(name, value);
userDirectoryService.commitEdit(ue);
The code should have a if(userDirectoryService.allowUpdateUser(userId)){...}
, but I will put this just when this permission issue have been troubleshooted (if I put this now, nothing happens: no permission)
Any advice?
Thanks