It's all about the answers!

Ask a question

does programmatically setting workitem state use role permissioning?


Roderick Thomas (661179) | asked Nov 03 '12, 4:02 p.m.
I have a custom work item that programmatically goes from state to state. I'd like to configure and prevent users of the system from being able to choose actions and going from one state to another. 

Programmatically, if the state is changed on the server through setting the WI action through an operational follow-up action, does it check the role based permissions? If so, is there a standard role the programming API uses? 

I'm trying to understand how it could work, so any guidance is appreciated..

3 answers



permanent link
sam detweiler (12.5k6184201) | answered Nov 05 '12, 12:04 a.m.
you have to logon to use the api,, so the user is whoever logged on.. 

the Eclipse client uses the same API, so yes, the permissions are checked as normal.

permanent link
Ralph Schoon (59.7k23643) | answered Nov 05 '12, 4:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As Sam explains there is always a user. In your case however, the user that would be used in the Participant is the user that triggered the operation. So the user would have to have the right to do so and I can't see how to make this work in a Participant. A different approach would be to run a client or server job that uses a different user and does the state change in a different context. In this case it would be possible to prevent the normal users from changing the state while allowing the automation user to do so.

permanent link
sam detweiler (12.5k6184201) | answered Nov 05 '12, 5:16 p.m.
but you could do this in an advisor.. participant is after the fact.. advisor is before.
you can't stop them from trying.. the  RTC model is to fail the save, not prevent the request.

Comments
Ralph Schoon commented Nov 06 '12, 1:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Right, I did not think about an advisor that would check the role and prevent from saving. Good catch.

Your answer


Register or to post your answer.