Mastering ServiceNow Scripting: Leverage JavaScript APIs to perform client-side and server-side scripting on ServiceNow instances by Andrew Kindred
Author:Andrew Kindred [Kindred, Andrew]
Language: eng
Format: epub
Tags: COM000000 - COMPUTERS / General, COM088000 - COMPUTERS / System Administration / General, COM005000 - COMPUTERS / Enterprise Applications / General
Publisher: Packt Publishing
Published: 2018-02-27T00:00:00+00:00
Figure 5.7: UI action to assign an incident to the logged in user
Often with UI actions, the script may not need to be that long to be an effective solution and add value to the user.
Finally, we will take a look at an access control script example. Sometimes it may be necessary to restrict access to a single group and exclude even system admins from seeing records.
We will use the change request table for this example, but obviously, other read access controls exist that would need to be deactivated for our new access control to work. We will only allow the eCAB Approval group access to Software category changes.
Let's take a look at the code:
answer = false;
if (current.category == 'Software') {
if (gs.getUser().isMemberOf('eCAB Approval')) {
answer = 'true';
}
} else {
answer = 'true';
}
Here, we are allowing access if the category is not Software; or, if it is Software, the user must be a member of the eCAB Approval group. We are clearing the Admin overrides checkbox, so even an admin will need to adhere to the rule to gain access. We also add the itil role to the rule to ensure that this role is needed for access to be given.
We can see the rule that we have created in Figure 5.8:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7408)
Supercharging Productivity with Trello by Brittany Joiner(6668)
Mastering Tableau 2023 - Fourth Edition by Marleen Meier(6437)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6424)
Inkscape by Example by István Szép(6287)
Visualize Complex Processes with Microsoft Visio by David J Parker & Šenaj Lelić(5981)
Build Stunning Real-time VFX with Unreal Engine 5 by Hrishikesh Andurlekar(4983)
Design Made Easy with Inkscape by Christopher Rogers(4641)
Customizing Microsoft Teams by Gopi Kondameda(4179)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3939)
Extending Microsoft Power Apps with Power Apps Component Framework by Danish Naglekar(3766)
Business Intelligence Career Master Plan by Eduardo Chavez & Danny Moncada(3757)
Salesforce Platform Enterprise Architecture - Fourth Edition by Andrew Fawcett(3644)
Pandas Cookbook by Theodore Petrou(3619)
The Tableau Workshop by Sumit Gupta Sylvester Pinto Shweta Sankhe-Savale JC Gillet and Kenneth Michael Cherven(3419)
TCP IP by Todd Lammle(2994)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2924)
Exploring Microsoft Excel's Hidden Treasures by David Ringstrom(2887)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2884)
