Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DT-1202: Allow creating datasnapshot as a child resource of dataset #1640
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
DT-1202: Allow creating datasnapshot as a child resource of dataset #1640
Changes from all commits
b8264a0
a6ce39f
55e4e0f
153210d
353ab99
ab13315
afb49c0
7604e4d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What is this action for? I think you probably want
set_parent
. https://github.com/broadinstitute/sam/blob/develop/README.md#resource-and-policy-managementThere 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 got it from https://github.com/broadinstitute/sam/blob/develop/src/main/scala/org/broadinstitute/dsde/workbench/sam/model/SamModel.scala#L34
which is used by
requireCreateWithOptionalParent
: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.
It looks like when this was added in #1441, the README wasn't updated. I can switch to using
set_parent
if that's preferred. Relevant slack thread: https://broadinstitute.slack.com/archives/C03GMG4DUSE/p1715026844061349There 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.
Interesting. I guess you can keep your
create_with_parent
. If I had been paying attention, I might have suggested that they useset_parent
but not grantremove_child
on the parent.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.
Well, TDR is the only user of
create_with_parent
so we could stop doing it if you want us to. I don't have a strong opinion one way or the other.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.
You don't actually need to grant
create_with_parent
to anyone. The action's existence on the resource type is used only as a flag to allow resources to be created with a parentThere 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.
When I tested this change in a bee, I found that it didn't work until I added
create_with_parent
as an action on thesteward
(owner) role.I also tried adding
create_with_parent
as an action oncustodian
, which is included bysteward
, but that didn't work.Looking at the Scala code, in
SecurityDirectives.requireCreateWithOptionalParent()
:It appears that this is what the code is requiring -- the action must directly be on the owner role.
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'm wondering if the failure of this to work with included roles is a bug. Looking at the code path for the
set_parent
operation (ResourceRoutes.setResourceParent()
), the code usesSecurityDirectives.requireAction()
which looks like it does support included roles.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 need "get_parent"?
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 think we'll need it in the UI, to find out of a snapshot has a parent dataset which is providing steward users to the snapshot. The UI can use this to fetch and show the dataset custodian users as "inherited" stewards in the
Roles & Memberships
tab.