I sometimes need to grant a user profile private authority to one or more objects, based on another user’s private authority to the same or a different object. While the Grant Object Authority (GRTOBJAUT) command allows you to assign private authorities to an object as a result of private authorities associated with a reference object, the GRTOBJAUT is only capable of doing so on an all-or-nothing basis. If you specify a reference object on the GRTOBJAUT command, this results in all private authorities associated with the reference object being copied to the specified target object or group of objects. The GRTOBJAUT doesn’t allow you to combine the command’s USER and REFOBJ/REFOBJTYPE parameters.
Furthermore, I recently decided to create a command that, as part of the move-object-to-production process, would set the object ownership, object primary group, object authorization list, and object private authority to the same values as defined by a specified reference object. Part of this challenge required a facility to copy a given user’s private authority to a reference object to another user and another object. To accommodate the mentioned requirements, I wrote the Copy User Authority (CPYUSRAUT) command.