The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Catalog UI Policy

davidsmith
Tera Expert

Hello,

I am setting up  new Catalog Item that allows users to request software to be checked by Infosec staff so that they can check on privacy settings and so on. I have some varibales/questions that are visible to the user and some that need to be on visible to the Infosec member of staff. How do I acheive this via a Catalog UI Policy?

 

David

13 REPLIES 13

GlideFather
Tera Patron

Hi @davidsmith,

 

it would be easier to achieve this by Catalog Client Script rather than Catalog UI Policy Action(s)..

 

You can refer to this g_user:

 

hasRole(String role, Boolean includeDefaults)

Returns true if the current user has the specified role or the admin role.
Parameters
Name Type Description
roleStringRole to check.
includeDefaultsBooleanOptional. Flag that indicates whether to include default roles, such as snc_internal and snc_external, in the request. For additional information on roles, see Exploring user administration.

Default: false

Returns
Type Description
BooleanReturns true if the current user has the specified role or the admin role; otherwise returns false.

Example

 

 

var isInternal = g_user.hasRole('snc_internal', true);

Example

 

 

var isItil = g_user.hasRole('itil');

hasRoleExactly(String role, Boolean includeDefaults)

Determines whether the current user has the specified role.
Parameters
Name Type Description
includeDefaultsBooleanOptional. Flag that indicates whether to include default roles, such as snc_internal and snc_external, in the request. For additional information on roles, see

Explicit roles.

Default: false

roleStringRole to check.
Returns
Type Description
BooleanReturns true if the current user has the specified role.

Example

 

 

var isInternal = g_user.hasRoleExactly('snc_internal', true);

Example

 

 

var isItil = g_user.hasRoleExactly('itil');

hasRoleFromList(String roles, Boolean includeDefaults)

Returns true if the current user has at least one of the specified roles or has the admin role.
Parameters
Name Type Description
rolesStringComma-separated list of roles to check
includeDefaultsBooleanOptional. Flag that indicates whether to include default roles, such as snc_internal and snc_external, in the request. For additional information on roles, see Exploring user administration.

Default: false

Returns
Type Description
BooleanReturns true if the current user has a role in the list or the admin role.

Example

 

 

var isOK = g_user.hasRoleFromList("itil, maint");

Example

 

 

var isOK = g_user.hasRoleFromList("itil, maint, snc_internal", true);

hasRoles(Boolean includeDefaults)

Returns true if the current user has any role.
Parameters
Name Type Description
includeDefaultsBooleanOptional. Flag that indicates whether to include default roles, such as snc_internal and snc_external, in the request. For additional information on roles, see Exploring user administration.

Default: false

Returns
Type Description
BooleanReturns true if the current user has at least one role.

Example

 

 

var yesRole = g_user.hasRoles();

Example

 

 

var yesRole = g_user.hasRoles(true);
 

 

———
/* If my response wasn’t a total disaster ā†™ļø ⭐ drop a Kudos or Accept as Solution āœ… ā†˜ļø Cheers! */


Hi @davidsmith, have you had chance to review my answer above?

 

Please let me know how does it sound to you, please don't ghost my free time efforts :))

———
/* If my response wasn’t a total disaster ā†™ļø ⭐ drop a Kudos or Accept as Solution āœ… ā†˜ļø Cheers! */


Hi @GlideFather Thank you for your help on this. It does make sense to me but I just need time to implement and test.

Kind regards

David

Hi @davidsmith,

any feedback?

———
/* If my response wasn’t a total disaster ā†™ļø ⭐ drop a Kudos or Accept as Solution āœ… ā†˜ļø Cheers! */