Topic
  • 2 replies
  • Latest Post - ‏2013-12-24T19:28:52Z by Bzoo
Bzoo
Bzoo
71 Posts

Pinned topic Permission Hook Problem:

‏2013-12-21T05:48:19Z |

 All:

Clearquest Windows7 Client (7.1.2.08) ( MS ACCESS)

I have a permission hook on a field "Bug"

Field Name: Bug

Type:   SHORT_STRING

It has a ChoiceList containg an array of choices (@choices)

The field  "Bug" has  2 states " Submitted" and   "Approved"

They both have "USE_HOOK". The permission code(perl) is as follows:

 

If ($Reqd){

$result = $CQPerlExt::CQ_MANDATORY;

}

else{

$result = $CQPerlExt::CQ_READONLY;

}

 When it goes to "Approved" state,

using  outputDebugString, I can verify that $Reqd =1 $result = 1( which means Mandatory)

But still, the field "Bug" is not editable. Its label does  not turn red to indicate that it is mandatory.

On the other hand the field "Bug" is greyed out.

Any idea why this behavior?

 

Thanks for your help

Bzoo

  • pdubovitsky
    pdubovitsky
    376 Posts
    ACCEPTED ANSWER

    Re: Permission Hook Problem:

    ‏2013-12-22T00:48:55Z  

    "USE_HOOK" permissions evaluated once, when action is initiated. If you changed "Bug" field value after the action was initiated and before it was committed, the field permissions would not be changed. You need to use SetFieldRequirednessForCurrentAction API call instead.

    Pavel

  • pdubovitsky
    pdubovitsky
    376 Posts

    Re: Permission Hook Problem:

    ‏2013-12-22T00:48:55Z  

    "USE_HOOK" permissions evaluated once, when action is initiated. If you changed "Bug" field value after the action was initiated and before it was committed, the field permissions would not be changed. You need to use SetFieldRequirednessForCurrentAction API call instead.

    Pavel

  • Bzoo
    Bzoo
    71 Posts

    Re: Permission Hook Problem:

    ‏2013-12-24T19:28:52Z  

    "USE_HOOK" permissions evaluated once, when action is initiated. If you changed "Bug" field value after the action was initiated and before it was committed, the field permissions would not be changed. You need to use SetFieldRequirednessForCurrentAction API call instead.

    Pavel

    Hi Pavel:

     

    Thanks for your hint. It really worked when I applied  SetFieldRequirednessForCurrentAction.

    during the initialization.

    It  is a great help.

     

    Thanks again

    Bzoo.