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]
ReturnsTrue
when the user has RACF Special 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.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 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_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 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_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
}
}
}