How do you restrict Template creation by role?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2018 09:34 AM
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.
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) - users with role 'inc_template' CANNOT create new templates on the Change table (or any other table)
(see Example 3)
Any ideas or suggestions on how to accomplish this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2018 09:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2018 09:58 AM
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.