4 | | TODO: To be described. |
| 4 | The following operations are provided along with the plugin: |
| 5 | |
| 6 | * Set the owner of the resource |
| 7 | * Set the owner of the resource to the currently logged-in user |
| 8 | |
| 9 | [[BR]] |
| 10 | [[BR]] |
| 11 | |
| 12 | == Set resource owner == |
| 13 | |
| 14 | === Syntax === |
| 15 | '''set_owner''' |
| 16 | |
| 17 | [[BR]] |
| 18 | === Parameters === |
| 19 | The user will be asked who to assign the resource to, via a text box or a drop-down list, depending on the following setting. |
| 20 | |
| 21 | There are three options (the following examples assume a workflow is associated to Test Case resource): |
| 22 | |
| 23 | 1. Let the user specify the new owner, without guidance and without any restriction. This is the default behavior. |
| 24 | |
| 25 | 2. Let the user specify the new owner, but chosen among a fixed set of users, specified in the trac.ini file: |
| 26 | |
| 27 | {{{ |
| 28 | [testcase] |
| 29 | available_owners = user2,user3 |
| 30 | }}} |
| 31 | |
| 32 | 3. Let the user specify the new owner, but present a list of the known users that have the permission specified in the trac.ini file: |
| 33 | |
| 34 | {{{ |
| 35 | [testcase] |
| 36 | restrict_owner = true |
| 37 | restrict_owner_to_permission = WIKI_MODIFY |
| 38 | }}} |
| 39 | |
| 40 | [[BR]] |
| 41 | === Requirements === |
| 42 | The resourceworkflowstate class must have been added the custom property "owner". |
| 43 | To do this, add the following to trac.ini: |
| 44 | |
| 45 | {{{ |
| 46 | [resourceworkflowstate-tm_custom] |
| 47 | owner = text |
| 48 | owner.value = |
| 49 | }}} |
| 50 | |
| 51 | [[BR]] |
| 52 | === Example === |
| 53 | |
| 54 | Adding a workflow to Test Cases, and specifying that when transitioning to the "singing" state, the sample_operation and the set_owner operations should be performed. |
| 55 | |
| 56 | {{{ |
| 57 | [testcase-resource_workflow] |
| 58 | sing = new -> singing |
| 59 | sing.permissions = TEST_MODIFY |
| 60 | sing.operations = sample_operation,set_owner |
| 61 | |
| 62 | calmdown = singing -> calm |
| 63 | calmdown.permissions = TEST_MODIFY |
| 64 | |
| 65 | [resourceworkflowstate-tm_custom] |
| 66 | owner = text |
| 67 | owner.value = |
| 68 | }}} |
| 69 | |
| 70 | [[BR]] |
| 71 | [[BR]] |
| 72 | == Set resource owner == |
| 73 | |
| 74 | === Syntax === |
| 75 | '''set_owner_to_self''' |
| 76 | |
| 77 | [[BR]] |
| 78 | === Parameters === |
| 79 | None |
| 80 | [[BR]] |
| 81 | === Requirements === |
| 82 | The resourceworkflowstate class must have been added the custom property "owner". |
| 83 | To do this, add the following to trac.ini: |
| 84 | |
| 85 | {{{ |
| 86 | [resourceworkflowstate-tm_custom] |
| 87 | owner = text |
| 88 | owner.value = |
| 89 | }}} |
| 90 | [[BR]] |
| 91 | === Example === |
| 92 | |
| 93 | Adding a workflow to Test Cases, and specifying that when transitioning to the "singing" state, the set_owner_to_self operation should be performed. |
| 94 | |
| 95 | {{{ |
| 96 | [testcase-resource_workflow] |
| 97 | sing = new -> singing |
| 98 | sing.permissions = TEST_MODIFY |
| 99 | sing.operations = set_owner_to_self |
| 100 | |
| 101 | calmdown = singing -> calm |
| 102 | calmdown.permissions = TEST_MODIFY |
| 103 | |
| 104 | [resourceworkflowstate-tm_custom] |
| 105 | owner = text |
| 106 | owner.value = |
| 107 | }}} |
| 108 | |
| 109 | [[BR]] |
| 110 | [[BR]] |