Special Authority

User Administration functions for accessing and modifying a user’s RACF Special Authority.

UserAdmin.has_special_authority()

def has_special_authority(self, userid: str) -> Union[bool, bytes]:

πŸ“„ Description

Β 

Having RACF Special authority is analogous to having Root authority on Linux.

Β 

Check if a user has RACF Special authority.

πŸ“₯ Parameters

  • userid
    The z/OS userid of the user whose authority is being checked.

πŸ“€ Returns

  • Union[bool, bytes]
    Returns True when the user has RACF Special authority and False otherwise. If the UserAdmin.generate_requests_only class attribute is set to True, concatenated Security Request XML bytes will be returned.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.

πŸ’» Example

Python REPL
>>> from pyracf import UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.has_special_authority("squidwrd")
False

UserAdmin.give_special_authority()

def give_special_authority(self, userid: str) -> Union[dict, bytes]:

πŸ“„ Description

Β 

Having RACF Special authority is analogous to having Root authority on Linux.

Β 

Give a user RACF Special authority.

πŸ“₯ Parameters

  • userid
    The z/OS userid of the user to give RACF Special authority.

πŸ“€ Returns

  • Union[dict, bytes]
    Returns a Security Result Steps dictionary or concatenated Security Request XML bytes if the UserAdmin.generate_requests_only class attribute is set to True.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.
  • AlterOperationError
    Raises AlterOperationError when the z/OS userid supplied cannot be altered because it does NOT exist.

πŸ’» Example

Python REPL
>>> from pyracf import UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.give_special_authority("squidwrd")
{'step1': {'securityResult': {'user': {'name': 'SQUIDWRD', 'operation': 'set', 'requestId': 'UserRequest', 'info': ['Definition exists. Add command skipped due  to precheck option'], 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'ALTUSER SQUIDWRD  SPECIAL     '}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
  "step1": {
    "securityResult": {
      "user": {
        "name": "SQUIDWRD",
        "operation": "set",
        "requestId": "UserRequest",
        "info": [
          "Definition exists. Add command skipped due  to precheck option"
        ],
        "commands": [
          {
            "safReturnCode": 0,
            "returnCode": 0,
            "reasonCode": 0,
            "image": "ALTUSER SQUIDWRD  SPECIAL     "
          }
        ]
      },
      "returnCode": 0,
      "reasonCode": 0
    }
  }
}

UserAdmin.take_away_special_authority()

def take_away_special_authority(self, userid: str) -> Union[dict, bytes]:

πŸ“„ Description

Β 

Having RACF Special authority is analogous to having Root authority on Linux.

Β 

Take away a user’s RACF Special authority.

πŸ“₯ Parameters

  • userid
    The z/OS userid of the user to take RACF Special authority away from.

πŸ“€ Returns

  • Union[dict, bytes]
    Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if the UserAdmin.generate_requests_only class attribute is set to True.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.
  • AlterOperationError
    Raises AlterOperationError when the z/OS userid supplied cannot be altered because it does NOT exist.

πŸ’» Example

Python REPL
>>> from pyracf import UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.take_away_special_authority("squidwrd")
{'step1': {'securityResult': {'user': {'name': 'SQUIDWRD', 'operation': 'set', 'requestId': 'UserRequest', 'info': ['Definition exists. Add command skipped due  to precheck option'], 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'ALTUSER SQUIDWRD  NOSPECIAL     '}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
  "step1": {
    "securityResult": {
      "user": {
        "name": "SQUIDWRD",
        "operation": "set",
        "requestId": "UserRequest",
        "info": [
          "Definition exists. Add command skipped due  to precheck option"
        ],
        "commands": [
          {
            "safReturnCode": 0,
            "returnCode": 0,
            "reasonCode": 0,
            "image": "ALTUSER SQUIDWRD  NOSPECIAL     "
          }
        ]
      },
      "returnCode": 0,
      "reasonCode": 0
    }
  }
}