-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dataset access support #1046
Conversation
Is an |
self.entity_type = entity_type | ||
self.entity_id = entity_id | ||
|
||
def __repr__(self): # pragma: NO COVER |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Is there a standalone ACL API for this like there is for |
entity_type = 'specialGroup' | ||
elif 'groupByEmail' in grant: | ||
entity_type = 'groupByEmail' | ||
else: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
An
Nope. |
for grant in access: | ||
grant = grant.copy() | ||
role = grant.pop('role') | ||
entity_type, entity_id = list(grant.items())[0] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Marshal access grants to/from dataset API requests/responses.
Rebased after merge of #1045. |
The back-end might return a grant with more than one entity_type for a given role. See: #1046 (comment)
@dhermes Any remaining issues? |
@tseaver We still have an unresolved question to @fhoffa. I'm not sure 09c1d14 does the trick. Also note the failure on Travis ======================================================================
FAIL: test__parse_access_grants_w_multiple_entity_types (gcloud.bigquery.test_dataset.TestDataset)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/GoogleCloudPlatform/gcloud-python/gcloud/bigquery/test_dataset.py", line 284, in test__parse_access_grants_w_multiple_entity_types
self._verifyAccessGrants(grants, RESOURCE)
File "/home/travis/build/GoogleCloudPlatform/gcloud-python/gcloud/bigquery/test_dataset.py", line 88, in _verifyAccessGrants
self.assertEqual(a_grant.entity_type, r_grant['entity_type'])
AssertionError: 'specialGroup' != 'userByEmail'
- specialGroup
+ userByEmail Is it possible the test is non-deterministic / depends on dictionary order? |
Also, de-lint long URL comments.
Let's get this in so we can get a BQ release, but I really do not want to drop this question. Calling LGTM |
#1050 opened to continue this discussion |
Uses #1045 as a base.Dataset.access_grants
property.Dataset
API requests/responses.