| LEADS_ONLY.pl Make sure only users ("leads") can perform certain VOB actions. Each VOB has there own VOB "lead" list. 
 | ||||||
| Author | : | A Better Solution, Inc. | ||||
| : | support@abs-consulting.com | |||||
| URL | : | https://abs-consulting.com | ||||
| Date | : | February 18, 2004 | ||||
This trigger script is expected to be called from a any pre-op trigger.
Create an element all trigger and apply to specified operations like:
cleartool mktrtype -ele -all -pre checkin -brtype main 
 -c "Only allow VOB Leads to checkin on the main branch." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY
or make a element trigger type and apply elements as needed:
cleartool mktrtype -ele -pre checkout 
 -c "Only allow VOB Leads to checkout certain files." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY_ON_DEMAND
cleartool mktrigger LEADS_ONLY_ON_DEMAND foo.c bar.c
or make a type trigger to prevent certain action from being performed:
cleartool mktrtype -type -pre mktype -brtype -all 
 -c "Only allow VOB Leads to create branch types." 
 -exec "{path}\perl {path}\LEADS_ONLY.pl" LEADS_ONLY_TRIGGER

If using ClearTrigger, just add a line in the configuration file like either of the keys below:
pre_checkin;R;;0;0;0;D; ;N; ;0;perl;{path}\LEADS_ONLY.pl;
pre_checkin;R;brtype<main>;0;0;0;D; ;N; ;0;perl;{path}\LEADS_ONLY.pl;
pre_checkin;R;;0;0;0;D; ;O;{foo.c}{bar.c};0;perl;{path}\LEADS_ONLY.pl;
You could also accomplish the same effect without writing any code by defining a cleartrigger alias (~leads) and then using either of the keys below:
pre_checkin;R;;0;0;0;A; ~leads ; 
pre_checkin;R;;0;0;0;D; ;N; ~leads ;0;;;;;0;Q;Only Leads can do this;C;
Read more on Policy without Triggers using ClearTrigger.