Individual Access
General Resource Profile Administration functions for checking an Individual User’s access to a General Resource Profile.
ResourceAdmin.get_my_access()
def get_my_access(self, resource: str, class_name: str) -> Union[str, bytes, None]:
📄 Description
Get the Running User’s access to a general resource profile.
📥 Parameters
-
resource
The general resource profile to get the running user’s access level for. -
class_name
The name of the class the specified general resource profile belongs to.
📤 Returns
Union[str, bytes, None]
ReturnsNone
when the general resource profile has no Your Access section defined for the running userid, otherwise the Access Level is returned 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_my_access("TESTING","ELIJTEST")
"read"
ResourceAdmin.get_user_access()
def get_user_access(self, resource: str, class_name: str, userid: str) -> Union[str, bytes, None]:
📄 Description
In order to use
get_user_access
, the caller must have at leastUPDATE
access to theuserid.IRRSMO00
resource in theSURROGAT
class, whereuserid
represents the specific userid you wish to check access for. More information about IRRSMO00 authorizations can be found here.
Get a Specified User’s access to a general resource profile.
📥 Parameters
-
resource
The general resource profile to get the specified user’s access level for. -
class_name
The name of the class the specified general resource profile belongs to. -
userid
The z/OS Userid whose access is being requested.
📤 Returns
Union[str, bytes, None]
ReturnsNone
when the general resource profile has no Your Access section defined for the specified userid, otherwise the Access Level is returned as a string. If theResourceAdmin.generate_requests_only
class attribute is set toTrue
, concatenated Security Request XML bytes will be returned.
❌ Raises
UserIdError
RaisesUserIdError
when the z/OS userid provided is not a string value between 1 to 8 characters in length.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_user_access("TESTING","ELIJTEST","SQUIDWRD")
"update"