- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2014 05:13 AM
Hi,
I have created the following UI action for the creation of a project record from another table.
Condition: !current.project.hasValue()
Script:
var project = new GlideRecord("pm_project");
project.u_name = current.u_project_name;
project.description = current.description;
var sysID = project.insert();
current.u_project = sysID;
var mySysID = current.update();
gs.addInfoMessage("Project " + project.number + " created");
action.setRedirectURL(change);
action.setReturnURL(current);
I would like to make this UI action available to users with the project_manager role only.
How do I add this to the script'?
Thanks in anticipation.
Emma
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2014 05:15 AM
add gs.hasRole('project_manager') to your condition.
!current.project.hasValue() && gs.hasRole('project_manager')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2014 05:15 AM
add gs.hasRole('project_manager') to your condition.
!current.project.hasValue() && gs.hasRole('project_manager')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2014 05:15 AM
Make the condition
!current.project.hasValue() && gs.hasRole('project_manager');