-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix permissions on share workflows #914
Conversation
@dlpzx Have you deployed and tested the changes yet? |
@@ -849,17 +849,20 @@ def _find_all_share_item(session, share, status, share_type_model, share_type_ur | |||
) | |||
|
|||
@staticmethod | |||
def find_all_share_items(session, share_uri, share_type): | |||
return ( | |||
def find_all_share_items(session, share_uri, share_type, status=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we pass this status
parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check the share item status, now we need to filter by that field. For example for "delete table permissions to requesters for revoked tables" we need to find all share items that are tables and are in Revoke_Approved
permissions=DATASET_TABLE_READ, | ||
resource_uri=table.itemUri, | ||
resource_type=DatasetTable.__name__, | ||
if share.groupUri != dataset.SamlAdminGroupName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we add this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the description as well. If a table is shared, the requesters will be given permissions to read the table (to preview it). The dataset owner already has those permissions, because it is the owner and those permissions where granted when the table was created. There is a possibility that the requester team is also the dataset owner. In such case those permissions would be duplicated
group=share.groupUri, | ||
resource_uri=dataset.datasetUri, | ||
) | ||
if share.groupUri != dataset.SamlAdminGroupName: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we add this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved following review by @dbalintx and @itsmo-amzn
Feature or Bugfix
Detail
There has been a mismatch on the permissions-granting in the shares. There are 2 types of permissions: on the share_object and preview permissions for requesters in the shared_tabled
In this PR:
approve_share_object
revoke_items_share_object
remove_shared_item
if the removed item is a table and was in Share_FailedRelates
Security
Please answer the questions below briefly where applicable, or write
N/A
. Based onOWASP 10.
fetching data from storage outside the application (e.g. a database, an S3 bucket)?
eval
or similar functions are used?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.