CL Command Reference - CRTAUTHLR
CL Command List > CRTAUTHLR Reference
Description:
he Create Authority Holder (CRTAUTHLR) command allows a user to create an authority holder to secure an object of type *FILE before it exists on the system. The file must be a program-described database file. When an object by the specified name is created, the authorities specified in the authority holder are linked to the newly created object.
The authority holder is associated with one specific object, object type, and library. This allows only users with the correct authority to access the object. The authority holder and associated object always have the same owner.
If the object has authorities associated with it, they are linked to the newly created authority holder. The owner of the object becomes the owner of the authority holder. Authority holders are located in library QSYS.
Restrictions:
. This command is shipped with public *EXCLUDE authority.
. The object type to be secured by the new authority holder is limited to *FILE. The file must be a program-described database file.
. The authority holder cannot be created for objects located in libraries QRCL, QRECOVERY, QSPL, QSPLxxxx, QSYS, or QTEMP.
. Authority holders can only secure files in the system auxiliary storage pool (ASP) or a basic user ASP.
Examples:
CRTAUTHLR OBJ(QGPL/FIL1) AUT(*EXCLUDE)
This command creates an authority holder for object FIL1 in library QGPL with *EXCLUDE authority.
GRTOBJAUT OBJ(QGPL/FIL1) TYPE(*FILE) USER(TWO) AUT(*USE)
By running this command, *USE authority is granted to user TWO for the authority holder that secures file FIL1 in library QGPL.
CRTSRCF FILE(QGPL/FIL1)
By running this command, user ONE creates a file that has a matching authority holder. User ONE becomes the owner of the file with user TWO having *USE authority to QGPL/FIL1.