12.11 Prevent Use of Certain Commands

To control which users can execute certain commands on ClearCase objects, you can create a pair of trigger types-one to control the use of the command on element-related objects, and one to control the use of the command on type objects. Both trigger types use the -nuser flag to specify the users who are allowed to use the command.

NOTE: You cannot use triggers to prevent a command from being used on an object that is not element related or a type object. For example, you cannot create a trigger type to prevent operations on VOB objects or replica objects.

For a list of commands that can be triggered, see the events_ccase and mktrtype reference pages.

For example, the following commands create two trigger types that prevent all users except stephen, hugh, and emma from running the chmaster command on element-related objects and type objects in the current VOB:

cleartool mktrtype -element -all -preop chmaster -nusers stephen,hugh,emma ^
-execunix "Perl -e \"exit -1;\"" -execwin "ccperl -e \"exit (-1);\"" ^
-c "ACL for chmaster" elem_chmaster_ACL

cleartool mktrtype -type -preop chmaster -nusers stephen,hugh,emma ^
-execunix "Perl -e \"exit -1;\"" -execwin "ccperl -e \"exit (-1);\"" ^

-attype -all -brtype -all -eltype -all -lbtype -all -hltype -all ^
-c "ACL for chmaster" type_chmaster_ACL

When user tony tries to run the chmaster command on a restricted object, the command fails. For example:

cleartool chmaster -c "give mastership to london" london@\dev \
\dev\acc.c@@\main\lex_dev

cleartool: Warning: Trigger "elem_chmaster_ACL" has refused to let chmaster proceed.
cleartool: Error: Unable to perform operation "change master" in replica "lex" of VOB "\dev".