oncell client script

sola2
Tera Contributor

can someone tell me how can i restrict to one specific user the visibility of all class named Cloud Host in the configuration item list?

6 REPLIES 6

Community Alums
Not applicable

Pratiksha
Mega Sage
Mega Sage

Hi @sola2,

 

You can try this via ACL. 

 

Below is sample script

 

// Get the current user's sys_id
var userSysId = gs.getUserID();

// Replace with the sys_id of the specific user you want to allow
var allowedUserSysId = 'specific_user_sys_id';

// Get the CI class name
var ciClassName = current.sys_class_name;

// Allow access if the current user is the specific user and the CI is of class Cloud Host
if (userSysId == allowedUserSysId && ciClassName == 'Cloud Host') {
answer = true;
} else {
answer = false;
}

 

Regards,

Pratiksha

@Pratiksha  should it still have a role? I have it like this so far

sola2_0-1715961909567.pngsola2_1-1715962296962.png

 

Which role? If you know which roles should not have access then we dont need the script.