Question posted 4/23/08 by Simon Details: Hello, I have small problem. In some of the transition we check if user executing transition is an assigned owner or is member of group that has privileges to execute transition any time (managers). We do have permission groups for people so 20 users can be assigned as a validator and they could execute validation transition. Problem is we don't want to let any user from validator group to validate record. We want to have only mangers and owner for that state to be able execute transition. I have script that checks if user is owner or from manager's group. Now i ran out into problem: with Shell.RedoMessage my transition stops in middle and it allows user to change owner of the state. This was set up for owner to be able to re-assign ticket to some other user. I tried both pre- and post- transitions scripts to stop unauthorised users from completing transition, but in each case i could change owner to current user and complete transition. What i needs is command or mechanism that in case of unauthorised attempt will stop transition from execution and won't let change owners. I was thinking about making field Read Only in that transition, but then original owner would not be able to re-assign if needed. Thanks Simon ABB Inc.
Comment posted 4/24/08 by Doru Voinea Simon, I sugest to use the system field SECONDARYOWNER, that can be updated with the proper user ID's of Manager on Submit transition, or other transition executed prior to validation. A good example is in the TeamtrackSample database provided with Serena's Teamtrack 6.5,6.5. The flow close to your request is named "Change Requests"
Comment posted 4/24/08 by Simon We have group or managers, and we might use same script to check if users are in other groups. Even if i use secondary owner, i'm running into same problem with canceling transition and not allowing user to add himself as an owner. Also now we assign secondary owner too, in case first one will be unavailable for some reason. Thanks for idea anyways
Comment posted 4/24/08 by Bill Gross You would have to build the logic into your script to check to see if the user has added themselves to the manager field. If you use the GetValue() method, you retrieve the information on the current transition form, if you use GetDBValue, you retrieve the value stored on the database before what's on the current transiton form is written.
Not the script referenced above but here's a function I use in many places to see if a user is a member of a group. It will be happy with either the internal ID, display name, or login name of the user.
function isGroupMember(userID, groupName)
dim membersRec, where
set membersRec = ext.createAppRecord(ext.TableID("TS_MEMBERS"))