How do you restrict Template creation by role?

apriled
Tera Expert

We have a need to restrict the creation of Templates [sys_templates] by role. When a user with the clicks New Template (see Example 1) we want them to only be able to create Templates allowed by that role.
find_real_file.png

For example:

  • users with role 'inc_template' can only create new templates on the Incident table
  • users with role 'chg_template' can only create new templates on the Change table
    (see Example 2)
    find_real_file.png
  • users with role 'inc_template' CANNOT create new templates on the Change table (or any other table)
    (see Example 3)
    find_real_file.png

Any ideas or suggestions on how to accomplish this?



2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

You  will have to update below ACLs and add your role for incidents for it. Similarly there will be ACLs for Change and problem where you need to add the respective roles.

 

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

SanjivMeher
Kilo Patron
Kilo Patron

I just noticed, you are talking about creating templates from the template module itself.

So you need an onLoad client script 

 

if (g_user.hasRole('inc_template'))

{

g_form.setValue('table','incident');

g_form.setReadOnly('table','true');

}

else if (g_user.hasRole('chg_template'))

{

g_form.setValue('table','change_request');

g_form.setReadOnly('table','true');

}


Please mark this response as correct or helpful if it assisted you with your question.