Admin Duty Separation with a Single Account
If you typically use a single account for your "admin" duties, as well as for creating and updating tasks, approving changes, and so on, it would be easy to accidentally utilize your "admin override" functionality without even knowing it. There is no notification or other indicator when you're only able to see some option because you're an admin and thus overriding an ACL! You might end up accidentally making some change that you shouldn't be able to make, such as approving or changing the state of a change record that would otherwise be locked down.
To avoid this, some companies require that admins have two separate accounts: one "normal" account with their group's non-admin roles, and a separate "admin" account that they must log into locally on the instance. This is an okay solution, but requires a lot of flipping back-and-forth, makes it difficult to update tickets as you're working on stuff, and often leads to people just using their admin account for everything because it's more convenient.
There is however, a better way! To avoid accidentally using your "admin powers" when you don't mean to, you can simply set the admin role to an elevated privilege!
Okay, so perhaps "simply" wasn't the right word to use there, but it can be done without too much hassle. Unfortunately, the Elevate privilege field on the admin role is protected by an ACL that cannot be modified or deactivated based on its protection policy. While you cannot bypass the protection policy to modify this ACL, you can bypass the ACL itself using a background script. To make admin an elevated privilege, follow the steps below:
- Elevate to Security admin so you can modify role records.
- Open the background scripts module from System Definition > Scripts – Background.
- Run the following script:
var grAdminRole = new GlideRecord('sys_user_role');
grAdminRole.addQuery('name', 'admin');
grAdminRole.setLimit(1);
grAdminRole.query();
if (grAdminRole.next()) { grAdminRole.setValue('elevated_privilege', true); grAdminRole.update();
}
Once you're done, be sure to navigate to the admin role in the sys_user_role table, and update the description to something more succinct (since this will show in the "elevate roles" dialog).
The one main down-side to this approach, is that it makes the admin role elevated for everyone - including the OOB system administrator account. This mainly causes an issue whilst deploying update sets.
You should be able to get around this pretty easily, by adding additional roles to the system admin account to ensure that it has all the permissions it needs even outside of the admin role; and you’ll need to make sure you use the system administrator account for instance-to-instance calls, such as retrieving update sets and such.
It may take a little bit of ACL-fiddling (and I may write a script at some point to automatically update all admin-dependent ACLs to work with a secondary admin role), but you should be able to sort this out without too much trouble in your instance.
I’ve been using this in one of my instances for a few months, and aside from the above-mentioned issue deploying update sets, and an issue with a scheduled script that was running under the system account (both of which were easy fixes), I’ve had no major issues.
Special thanks to Top Tanti for helping me bypass the protected ACL to make this work!
- March 2024
- February 2024
- Feb 12, 2024 5 Lessons About Programming From Richard Feynman Feb 12, 2024
- July 2023
- May 2023
- April 2023
- December 2022
- Dec 13, 2022 ServiceNow Developers: BE THE GUIDE! Dec 13, 2022
- October 2022
- August 2022
- March 2022
- February 2022
- May 2021
- April 2021
- February 2021
- November 2020
- Nov 17, 2020 SN Guys is now part of Jahnel Group! Nov 17, 2020
- September 2020
- July 2020
- January 2020
- Jan 20, 2020 Getting Help from the ServiceNow Community Jan 20, 2020
- December 2019
- November 2019
- April 2019
- March 2019
- February 2019
- Feb 27, 2019 Making Update Sets Smarter - Free Tool Feb 27, 2019
- November 2018
- October 2018
- September 2018
- July 2018
- Jul 23, 2018 Admin Duty Separation with a Single Account Jul 23, 2018
- June 2018
- May 2018
- May 29, 2018 Learning ServiceNow: Second Edition! May 29, 2018
- April 2018
- March 2018
- February 2018
- Feb 11, 2018 We have a new book! Feb 11, 2018
- November 2017
- September 2017
- Sep 12, 2017 Handling TimeZones in ServiceNow (TimeZoneUtil) Sep 12, 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- Mar 12, 2017 reCAPTCHA in ServiceNow CMS/Service Portal Mar 12, 2017
- December 2016
- November 2016
- Nov 10, 2016 Chrome Extension: Load in ServiceNow Frame Nov 10, 2016
- September 2016
- July 2016
- May 2016
- May 17, 2016 What's New in Helsinki? May 17, 2016
- April 2016
- March 2016
- February 2016
- January 2016
- Jan 29, 2016 A Better, One-Click Approval Jan 29, 2016
- Jan 25, 2016 Quickly Move Changes Between Update Sets Jan 25, 2016
- Jan 20, 2016 Customize the Reference Icon Pop-up Jan 20, 2016
- Jan 7, 2016 ServiceNow: Geneva & UI16 - What's new Jan 7, 2016
- Jan 4, 2016 Detect/Prevent Update Set Conflicts Before They Happen Jan 4, 2016
- Jan 29, 2016 A Better, One-Click Approval Jan 29, 2016
- December 2015
- Dec 28, 2015 SN101: Boolean logic and ServiceNow's Condition Builder Dec 28, 2015
- Dec 17, 2015 Locate any record in any table, by sys_id in ServiceNow Dec 17, 2015
- Dec 16, 2015 Detecting Duplicate Records with GlideAggregate Dec 16, 2015
- Dec 11, 2015 Array.indexOf() not working in ServiceNow - Solution! Dec 11, 2015
- Dec 2, 2015 Understanding Dynamic Filters & Checking a Record Against a Filter Using GlideFilter Dec 2, 2015
- Dec 28, 2015 SN101: Boolean logic and ServiceNow's Condition Builder Dec 28, 2015
- October 2015
- August 2015
- Aug 27, 2015 Easily Clone One User's Access to Another User Aug 27, 2015
https://snprotips.com/blog/2018/7/23/admin-duty-separation-with-a-single-account
Tim Woodruff