Universal Access
General Resource Profile Administration functions for checking a General Resource Profileβs Universal Access Attribute.
ResourceAdmin.get_universal_access()
def get_universal_access(self, resource: str, class_name: str) -> Union[str, bytes, None]:
π Description
Check the Universal Access Attribute for a general resource profile.
π₯ Parameters
-
resource
The general resource profile for which RACF should check the universal access attribute. -
class_name
The name of the class the general resource profile being checked belongs to.
π€ Returns
Union[str, bytes, None]
ReturnsNone
when the general resource profile has no Universal Access defined, otherwise returns the access level as a string. If theResourceAdmin.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 ResourceAdmin
>>> resource_admin = ResourceAdmin()
>>> resource_admin.get_universal_access("TESTING","ELIJTEST")
"read"
ResourceAdmin.set_universal_access()
def set_universal_access(
self,
resource: str,
class_name: str,
universal_access: str,
) -> Union[dict, bytes]:
π Description
Set the Universal Access Attribute for a general resource profile.
π₯ Parameters
-
resource
The general resource profile for which RACF should set the universal access attribute. -
class_name
The name of the class the general resource profile being altered belongs to. -
universal_access
The Universal Access level to set for the specified general resource profile.
π€ Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if theResourceAdmin.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 general resource profile cannot be altered because it does NOT exist.
π» Example
Python REPL
>>> from pyracf import ResourceAdmin
>>> resource_admin = ResourceAdmin()
>>> resource_admin.get_universal_access("TESTING","ELIJTEST","ALTER")
{"step1":{"securityResult":{"resource":{"name":"TESTING","class":"ELIJTEST","operation":"set","requestId":"ResourceRequest","info":["Definition exists. Add command skipped due to precheck option"],"commands":[{"safReturnCode":0,"returnCode":0,"reasonCode":0,"image":"RALTER ELIJTEST (TESTING) UACC (Alter)","messages":["ICH11009I RACLISTED PROFILES FOR ELIJTEST WILL NOT REFLECT THE UPDATE(S) UNTIL A SETROPTS REFRESH IS ISSUED."]}]},"returnCode":0,"reasonCode":0}}}
Security Result Steps Dictionary as JSON
{
"step1":{
"securityResult": {
"resource": {
"name": "TESTING",
"class": "ELIJTEST",
"operation": "set",
"requestId": "ResourceRequest",
"info": [
"Definition exists. Add command skipped due to precheck option"
],
"commands": [
{
"safReturnCode": 0,
"returnCode": 0,
"reasonCode": 0,
"image": "RALTER ELIJTEST (TESTING) UACC (Alter)",
"messages": [
"ICH11009I RACLISTED PROFILES FOR ELIJTEST WILL NOT REFLECT THE UPDATE(S) UNTIL A SETROPTS REFRESH IS ISSUED."
]
}
]
},
"returnCode": 0,
"reasonCode": 0
}
}
}