Need to check user group "Role" in UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-03-2023 06:32 AM
By using UI policy , i'm going to find the user 'group role . if the group role is itil_admin , will make the field editable for the particular user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-03-2023 11:13 PM
@subashds6515 - please change line 2 in your UI policy script, it should be
var isAdmin = g_user.hasRoles('itil_admin','admin');
If my answer has helped with your question please mark it as correct and helpful.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2023 03:00 AM
I am also try this way, but its not working.
function onCondition() {
var isAdmin = g_user.hasRoles('admin');
if (isAdmin) {
g_form.setReadOnly('short_description', false); // Title
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-05-2023 05:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2023 03:24 AM
To make a field read-only or editable based on user roles or group membership, use an ACL and not a UI Policy.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-04-2023 04:05 AM
When a user is added to a group, the user is also assigned with a role that are assigned to a group. you can do below. please mark it helpful if you find it helpful.
1 Navigate to "UI Policies" under "System UI" in the left-hand navigation pane.
2 Click the "New" button to create a new UI policy.
3 Give the UI policy a name such as "ITIL Admin Edit Field."
4 In the "Advanced" tab, set the "Table" field to the table that contains the field you want to make editable.
⢠In the "Conditions" tab, add a new condition with the following settings:
⢠Type: Script
⢠Condition: gs.hasRole('itil_admin')
⢠In the "Actions" tab, add a new action with the following settings:
⢠Type: Set Field Value
⢠Field: [Name of the field you want to make editable]
⢠Value: true
⢠Mandatory: Check the box to ensure that the field must be filled before the record can be saved.
5 Save the UI policy.
