Request and review access
When cooperating with several users, you may not have the specific permission you need on a feature set. You can request one from the feature set owners.
To begin, check your current access:
- Python
from h2o_featurestore.core.access_type import AccessType
my_access = fs.current_permission
# returns an AccessType, or None if you have no active permission
If your level of permission is not sufficient, request access:
- Python
request_id = fs.request_access(AccessType.CONSUMER, "Preparing the best model")
You can track your pending permission requests through the client API:
- Python
my_requests = client.acl.requests.feature_sets.list()
If you change your mind before a request is processed, you can cancel it by withdrawing it:
- Python
requests = list(client.acl.requests.feature_sets.list())
request = requests[0] # pick the request you want to withdraw
request.withdraw()
When a request no longer appears in the pending list, it has been
processed. To see the outcome, list your active permissions. The
filters argument is an optional list of permission-state strings —
"GRANTED", "REJECTED", or "PENDING". It defaults to ["GRANTED"]
(the most common case). If you do not find your original request granted,
it was most likely either rejected, or granted and then revoked.
- Python
# Granted permissions (default)
my_permissions = client.acl.permissions.feature_sets.list()
# Verify a rejected request by specifying the corresponding filter
rejected = client.acl.permissions.feature_sets.list(["REJECTED"])
Manage requests and permissions
As a feature set owner, other users can request access to your feature set.
To list the requests pending for you to handle, and either approve or reject them, call:
- Python
manageable = list(client.acl.requests.feature_sets.list_manageable())
request = manageable[0] # pick the request you want to handle
request.approve("it will be fun")
# or: request.reject("it's not ready yet")
To revoke access you have previously granted, list the manageable
permissions (not requests) and call revoke() on the one you want to
remove:
- Python
manageable = list(client.acl.permissions.feature_sets.list_manageable())
permission = manageable[0] # pick the permission you want to revoke
permission.revoke("user left the workspace")
Inspecting permissions and requests
The objects returned by the list() and list_manageable() methods expose
their state through properties (not method calls). The following is not
exhaustive:
- Python
for request in client.acl.requests.feature_sets.list_manageable():
request.user # the user associated with the request
request.access_type # requested AccessType
request.status # permission state
request.reason # reason provided with the request
request.resource_id # id of the target feature set
request.resource_type # resource type
request.created_on
request.last_update_on
fs = request.get_feature_set() # load the target feature set
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai