Restrict Service Catalog submission for non–key users with proper message on Employee Center

adityagalan
Tera Contributor

Hi All,

I am working on a requirement where I need some help to achieve the desired behavior in Employee Center.

Requirement:

  1. All service catalogs (with key user restriction) should be visible to all end users.

  2. However, only key users (members of a specific group) should be able to submit those catalogs.

  3. 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!

0 REPLIES 0