Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: Restrict Access to Test Plan Folder

$
0
0

Here is an example worlof script for you:

 

Go to Project's Customization -> Workflow -> Script Editor - > Test PLan

Add following script:

 

Sub SetTestFieldApp( FieldName, Vis, Req, Ro )
  'Sets a field's appearance
  With Test_Fields(FieldName)
    .IsVisible = Vis
    .IsRequired = Req
    .IsReadOnly = Ro
  End With
End Sub


Sub TestFolder_MoveTo
  On Error Resume Next
  if Test_Fields("TS_SUBJECT").Value  = "1001" then
     WizardTestFieldCust
     end if
  On Error GoTo 0
End Sub

Sub WizardTestFieldCust
    If User.IsInGroup("Developer") Then
        SetTestFieldApp "TS_NAME", True, False, True
        end if
          On Error GoTo 0
End Sub

 Some explanations:

 

So we have a sub WizardTestFieldCust  that calls SetTestFieldApp if user is in particular group.

In our case this group is "Developer".

 

Each time user selects a test we check if the parent folder's id is = 1001.

 

If it is we call WizardTestFieldCust.

 

If user is in developer froup we call SetTestFieldApp and pass is parameters:

 

"TS_NAME", True, False, True  

 

which are:

FieldName

.IsVisible = Vis
.IsRequired = Req
.IsReadOnly = Ro

 

so we set field TS_NAME to be visible, not required, and not editable.

 

What you need to do is:

- to add more fields to WizardTestFieldCust that you would like to be not editable.

- Set the user group for users who you don't want to edit certain fields

 - check for folders id's, where you have tests that you don't want to be edited

 

 

So it would look like:

Sub WizardTestFieldCust
    If User.IsInGroup("Developer") Then
        SetTestFieldApp "TS_NAME", True, False, True
        SetTestFieldApp "TS_STATUS", True, False, True
        SetTestFieldApp "TS_RESPONSIBLE", True, False, True
        end if
          On Error GoTo 0
End Sub

 

Good luck.


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>