- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 04:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 04:45 AM - edited ‎10-31-2022 04:45 AM
Hi @Giriprasath ,
Activate the Client script suggested by Namrata Ghorpad in the above post and change the script as suggested below:
function onLoad() {
if(!g_user.hasRole("admin"))
g_form.setVariablesReadOnly(true);
}
Out of the box this client script is inactive so, make sure to make it active before testing.
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 04:28 AM
Hello,
There is OOB client script to make variables read only - "Variable Editor Readonly" .
You can add your logic here to check current logged in user is Admin or not and based on that you can make variables read only.
Please mark my answer as helpful/correct if it helps you.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 04:45 AM - edited ‎10-31-2022 04:45 AM
Hi @Giriprasath ,
Activate the Client script suggested by Namrata Ghorpad in the above post and change the script as suggested below:
function onLoad() {
if(!g_user.hasRole("admin"))
g_form.setVariablesReadOnly(true);
}
Out of the box this client script is inactive so, make sure to make it active before testing.
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 05:11 AM - edited ‎10-31-2022 05:13 AM
Hi there,
You can write the below catalog Onload client script.
function onLoad() {
//Type appropriate comment here, and begin script below
var ruser = g_user.hasRoleExactly('admin');
if (!ruser) {
g_form.setReadOnly('list_of_assets', true); - //Add your fields which you have to make read only
}
}
Make sure you tick Applies on Requested item in Catalog client script.
If your issue got resolved close the question by Accepting solution and hit thumb icon.
Regards,
Gagan K