#
#
# INHIBIT.pl (Perl)
#
# For file/actions where this trigger is attached, inhibit
# this action to list members only.
#
# Author: Charles W. Clarke III (ABS)
# email:  charles@abs-consulting.com
# URL:    http://www.abs-consulting.com
# Date:   Aug. 16, 1996
############################################################
# History: 08/16/96 : Created for A Better Solution, Inc.
############################################################

This trigger script is expected to be called from a any pre-op trigger. 

Either create an element all trigger and apply
to specified operations like:

    cleartool mktrtype -ele -all -pre checkin -brtype main \
          -c "Prevents checking on main branch by anyone excepts members of a list." \
          -exec "{path}/perl {path}/INHIBIT.pl" INHIBIT_MAIN_CI
    
or make a element trigger type and apply as needed:

    cleartool mktrtype -ele -pre checkout \
          -c "Prevent anyone but list-members from checkout of certain files." \
          -exec "{path}/perl {path}/INHIBIT.pl" INHIBIT_ON_DEMAND

    cleartool mktrigger INHIBIT_ON_DEMAND foo.c bar.c
    
or make a type trigger to prevent certain action from being performed:

    cleartool mktrtype -type -pre mktype -trtype -all \
          -c "Prevent anyone but list-members from creating triggers in the VOB." \
          -exec "{path}/perl {path}/INHIBIT.pl" INHIBIT_TRIGGERS
    

Shortcut using...

If using ClearTriggerTM, you don't need to write ANY trigger code... 
Just add this line in the configuration file to specified operations (or operation groups) like any below: 

    pre_MODIFY_ELEM;R;;X;  
    pre_checkin;R;brtype<main>X;  
    pre_mktype;R;trtype<-all>X;  

Read more on Policy without Triggers using ClearTrigger.


View Trigger Code. (Perl)