Auditor Authority
User Administration functions for accessing and modifying a userβs Auditor Authority.
UserAdmin.has_auditor_authority()
def has_auditor_authority(self, userid: str) -> Union[bool, bytes]:
π Description
Check if a user has Auditor authority.
π₯ Parameters
userid
The z/OS userid of the user whose authority is being checked.
π€ Returns
Union[bool, bytes]
ReturnsTrue
when the user has Auditor authority andFalse
otherwise. If theUserAdmin.generate_requests_only
class attribute is set toTrue
, concatenated Security Request XML bytes will be returned.
β Raises
SecurityRequestError
RaisesSecurityRequestError
when the SAF Return Code of a Security Result is equal to4
.DownstreamFatalError
RaisesDownstreamFatalError
when the SAF Return Code of a Security Result is greater than4
.
π» Example
Python REPL
>>> from pyracf import UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.is_auditor("squidwrd")
False
UserAdmin.give_auditor_authority()
def give_auditor_authority(self, userid: str) -> Union[dict, bytes]:
π Description
Give a user Auditor authority.
π₯ Parameters
userid
The z/OS userid of the user to give Auditor authority.
π€ Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML string if theUserAdmin.generate_requests_only
class attribute is set toTrue
.
β Raises
SecurityRequestError
RaisesSecurityRequestError
when the SAF Return Code of a Security Result is equal to4
.DownstreamFatalError
RaisesDownstreamFatalError
when the SAF Return Code of a Security Result is greater than4
.AlterOperationError
RaisesAlterOperationError
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_auditor_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 AUDITOR '}]}, '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 AUDITOR "
}
]
},
"returnCode": 0,
"reasonCode": 0
}
}
}
UserAdmin.take_away_auditor_authority()
def take_away_auditor_authority(self, userid: str) -> Union[dict, bytes]:
π Description
Remove a userβs Auditor authority.
π₯ Parameters
userid
The z/OS userid of the user to take Auditor authority away from.
π€ Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if theUserAdmin.generate_requests_only
class attribute is set toTrue
.
β Raises
SecurityRequestError
RaisesSecurityRequestError
when the SAF Return Code of a Security Result is equal to4
.DownstreamFatalError
RaisesDownstreamFatalError
when the SAF Return Code of a Security Result is greater than4
.AlterOperationError
RaisesAlterOperationError
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_auditor_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 NOAUDITOR '}]}, '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 NOAUDITOR "
}
]
},
"returnCode": 0,
"reasonCode": 0
}
}
}