The CreatorCon Call for Content is officially open! Get started here.

How to show variable to a specific role/group

Souvick6917
Tera Contributor

Hi All, 

I have a requirement to restrict 2 variables visibility to a specific role/group. Only users containing the specific role will be able to view and work on the 2 variables of the catalog item.

Please provide help to achieve this requirement.

 

Regards

Souvick

2 ACCEPTED SOLUTIONS

Anand Kumar P
Giga Patron

Hi @Souvick6917 ,

In that variables you can see the Permissions tab to can define role  so that specific users can only see variables

AnandKumarP_0-1709534374119.png

Or
You can create onload catalog client script 

 

function onLoad() {
  if (!g_user.hasRole('admin')){
  g_form.setDisplay('variable1', false);
  }
  else{
  g_form.setDisplay('variable1', true);
}

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

 

View solution in original post

Aniket Chavan
Tera Sage
Tera Sage

Hello @Souvick6917,

You can restrict the variable visibility by using Permission section from your variable, please see the attached image down below,

AniketChavan_0-1709535490914.png


Please let me know if you have any further doubts or any blockers , so that we can discuss accordingly.

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks & Regards,

Aniket.

 

View solution in original post

7 REPLIES 7

Hi @Aniket Chavan 

 

address the right person...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Thank you for noticing and corrected my response.😅🙌

M Ismail
Tera Guru

Hi @Souvick6917,

You can control visibilty by adding read role in the permission tab of variable form,
here is just a example 

MIsmail_0-1709535867002.png

 Please hit helpful and accept this as a solution if it solved your problem.
Thank you!