The below code uploads file and grants role for a user. Upload succeeds, but grantForUser fails with fault FAULT = ‘Server.Processing’ [java.lang.NullPointerException] <java.lang.NullPointerException>
Thanks for update. I will try the API.
Will I be able to change Roles/Users permission from server code as well?
Below is email that was sent to Kate several hours ago.
Just want to let you know that setting user and role permission from server code does not work as well.
If Authenticated user uploads file and runs server code which modifies role permissions for AuthenticatedUser, there shouldn’t be any problem right? (file initially granted role permission of read, write, remove, permission for AuthenticatedUser which inherited from parents)
Thanks for the code Slava, I tried it and it works.
Sergey, regarding server code, as far as file permission is concerned, it seems like user is not logged in at the custom server code context, and it keeps throwing error 4000 (permission denied).
I can’t take a screenshot right now I left office, but I didn’t change permission to uploaded file. Default permission for uploaded file which inherites from parent is role permission for AuthenticatedUser.(read, write, permission, remove)
I just logged in with my phone and captured screenshot. As Sergey had no problem changing permission, I may have done something wrong so I will try tomorrow.
I thought it would work because logged in user calls the custom code, and ACL changes would be allowed since role permission for AuthenticatedUser is set.