Way to check access rights for user?

Hello, everyone.
In my application I want to implement the following behavior:
I have a logged in user, and and then I fetch other user’s file,
I want to know which access rights my current user has to that resource (ie read, append, write)
Is there a 100% way to do this? Because I know that sometimes this info is hidden.

And in case if info is hidden, is the only way to find out is to actually try to perform actions corresponding to access right (i.e to check read right, try to read the resource, if no error occurred then the user has read access and do the same for append and write)

On NSS where it is possible to give pod-wide access via acl:trustedApp, you can check if your app is listed as a trustedApp. Other than that, AFAIK, all rights are given on a per-resource basis. You do not, however, need to try to perform the actions. On serveres that support WAC, you can do a head request on the resource and look at the wac-allow header. That will tell you exactly what rights the current user/app have permissions for. On servers that support ACP, you can do a head request and look at the link header for the ACP relation.

2 Likes