How to make a field read only for users from a specific user group
Question ID: 107346

I would like to restrict some user groups from editing certain fields in existing defects. I don't want to go the permissions route as that is too general if I just want to block one field. I know workflow would be best to accomplish this, but unsure of the best method.

Marked as spam
Posted by (Questions: 104, Answers: 0)
Asked on January 18, 2017 2:42 pm
Answers (1)
Private answer


While I don't know your exact situation, here is a simple code example that could be added to the sub routine Bug_MoveTo that would restrict a user if they are in a user group X from editing a particular field. This would make the field read only if they are in the targeted group. Any other user group member can still write to the field.

My below example uses user group Developer and UDF of BG_USER_03.

Sub Bug_MoveTo
On Error Resume Next
If User.IsInGroup(Developer) then
Bug_Fields.Field(''BQ_USER_03'').IsReadOnly = true
End If
On Error GoTo 0
End Sub

Marked as spam
Posted by (Questions: 1, Answers: 116)
Answered on January 18, 2017 2:44 pm
Works great, thank you for the code example.
( at January 18, 2017 6:06 pm)

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

Scroll to Top