Check save permission of a user
I try to find out if a specific action is permitted for a specific User.
For example to save a work Item.
The return state IDetailedStatus object contains an ERROR enum and in addtion the message "Berechtigung verweigert" (permission denied). This seems to be localized and it is not the project areas local, because this is english in my case.
Is there a language independent way to find out, if the save operation is allowed for a specific user?
Best Regards,
Melanie
One answer
This related forum post can get you started: https://jazz.net/forum/questions/99322/how-to-get-the-permissions-set-on-a-user-programmaticallyserverside
Comments
Hi Lauren,
thank you for the fast answer.
Your link leads me to an explanation how to get the roles of a user.
This could be a first step because as far as I understood the permission is linked to the role.
Is there a way to figure out what permissions are assigned to a specific role?
I don't get the part from the linked posts and articel's. Could you provide a code sample?
Best regards
Hi Melanie,
I did a little searching, and I don't think it's possible to get the operations available per role. See https://jazz.net/forum/questions/119880/is-there-api-a-service-to-get-process-operation-permissions-per-role for more information.
Hi Lauren,
since the Eclipse client can get at the information on each level, I think it should be possible to gather this information, at least to some extend. This might require undocumented internal API's and it would also require some complex algorithms because it is necessary to follow https://jazz.net/library/article/292 and https://jazz.net/library/article/291. However, I think it would be possible to get at the data needed.
It would likely be a huge effort though.
1 vote