0

I want to know if there is any java method or any topics about how to know user role on a specific folder (Consumer, Contributor, Collaborator...)

For my project I use differentes methods, for example: uploadfile, create folder ...

Now I want to improve a user management, so if the user has the role consumer he can't delete a file. Any solution for this problem? Thank you

tumisma
  • 375
  • 3
  • 14
Yagami Light
  • 1,756
  • 4
  • 19
  • 39

2 Answers2

2

There are multiple ways you could do this. One is to ask the folder for its ACL by calling getACL(), see the docs.

Another option would be to ask the folder for its allowable actions by calling getAllowableActions(), see the docs. This one might be better because it will return given the context of the current user. If the getAllowableActions() call does not return "CAN_DELETE_OBJECT" then you know the current user is not allowed to delete the object.

Jeff Potts
  • 10,468
  • 17
  • 40
0

Try to take a look to this maybe it can help to solve your problem

http://ecmarchitect.com/archives/2014/04/28/3703

Andrea Girardi
  • 4,337
  • 13
  • 69
  • 98