SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Trying to restrict delete possibilities w/ script

    Hello! Hope someone can help. I am writing a workflow script that will restrict the users' possibilities to delete contents from the Test Lab module. I have added a user field to the test sets (CY_USER_01) that contains owner information. I want the following criteria to be fulfilled:
    1) Only the owner and the TDAdmin may delete information
    2) Closed test sets must not be deleted

    I have almost succeeded using the following code:
    <font class="small">Code:</font><hr /><pre>
    Function TestSet_CanDelete(Entity,IsTestSet)
    On Error Resume Next

    ' Must be owner or TDAdmin to delete:
    If TestSet_Fields("CY_USER_01").Value &lt;&gt; User.UserName Then
    If Not(User.IsInGroup("TDAdmin")) Then
    MsgBox "You are not allowed to delete information you do not own." _
    , vbInformation
    TestSet_CanDelete = False
    Exit Function
    End If
    End If

    ' OK to delete if test set isn't closed
    If TestSet_Fields("CY_STATUS").Value = "Closed" Then
    MsgBox "You are not allowed to delete closed test sets." _
    , vbInformation
    TestSet_CanDelete = False
    Exit Function
    End If

    TestSet_CanDelete = DefaultRes

    On Error GoTo 0
    End Function
    </pre><hr />

    The problem I have is that it won't work when the user have made multiple selections of objects in the test plan tree. The parameters sent to the code is just for the object that was selected last...

    What to do now?

    //David
    David Kaplan
    Test Lead
    Emerson Process Management, http://www.rosemount-tankradar.com

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Trying to restrict delete possibilities w/ scr

    Is there really nobody that can help?
    David Kaplan
    Test Lead
    Emerson Process Management, http://www.rosemount-tankradar.com

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:51 PM.

Copyright BetaSoft Inc.