Restrict Service Catalog submission for non–key users with proper message on Employee Center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi All,
I am working on a requirement where I need some help to achieve the desired behavior in Employee Center.
Requirement:
All service catalogs (with key user restriction) should be visible to all end users.
However, only key users (members of a specific group) should be able to submit those catalogs.
If a non–key user tries to submit, they should see a message on Employee Center with a link to a report showing the allowed group members, so they understand why they cannot raise the request.
What I tried:
Created a Script Include that checks whether the currently logged-in user belongs to the key user group (using GlideRecord).
Created an onSubmit Client Script that calls this Script Include:
If true → allow submission.
If false → prevent submission and show a message.
Issue faced:
Since the Script Include is synchronous, the condition is not properly evaluated in time.
As a result, even if the user is not part of the key user group, they are still able to submit the request.
My ask:
What is the correct way to handle this scenario?
Is there any other best practice to validate group membership before submission in Employee Center?
Any suggestions or examples would be highly appreciated.
Thanks in advance!