-
Notifications
You must be signed in to change notification settings - Fork 12
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
CORE-210 add can_access action #1604
Changes from 5 commits
50040e7
4d55bf5
48306b4
5d914d4
36de3a0
ef4fcf0
ab0319f
a398faf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog logicalFilePath="dummy" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"> | ||
|
||
<changeSet logicalFilePath="dummy" author="dvoet" id="rt_prereq_action_column"> | ||
<addColumn tableName="sam_resource_type"> | ||
<column name="prerequisite_action" type="VARCHAR"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a FK? I suppose the owner role isn't either so seems fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. making it a FK creates some circular headaches when creating resource types: insert the resource type first, then actions, then update the resource type. Not worth it IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious as to why the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the value is not built-in, it comes from configuration |
||
<constraints nullable="true"/> | ||
</column> | ||
</addColumn> | ||
</changeSet> | ||
</databaseChangeLog> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,6 +227,9 @@ resourceTypes = { | |
roleActions = ["compute"] | ||
descendantRoles = { | ||
google-project = ["notebook-user"] | ||
notebook-cluster = ["accessor"] | ||
kubernetes-app = ["accessor"] | ||
persistent-disk = ["accessor"] | ||
} | ||
} | ||
can-catalog = { | ||
|
@@ -798,6 +801,9 @@ resourceTypes = { | |
} | ||
notebook-cluster = { | ||
actionPatterns = { | ||
can_access = { | ||
description = "necessary but not sufficient to perform any action on the notebook cluster" | ||
} | ||
status = { | ||
description = "view notebook cluster status details and configuration" | ||
} | ||
|
@@ -826,17 +832,27 @@ resourceTypes = { | |
} | ||
ownerRoleName = "creator" | ||
roles = { | ||
# the creator role is assigned directly to the notebook-cluster resource and does not include can_access | ||
# but can_access is required to perform any action so must be granted via the parent resource using | ||
# either the manager or accessor role | ||
creator = { | ||
roleActions = ["status", "connect", "delete", "read_policies", "stop_start", "modify", "set_parent", "get_parent"] | ||
} | ||
manager = { | ||
roleActions = ["status", "delete", "read_policies"] | ||
roleActions = ["status", "delete", "read_policies", "can_access"] | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. manager is already a descendant role from workspace owner |
||
accessor = { | ||
roleActions = ["can_access"] | ||
} | ||
} | ||
reuseIds = false | ||
prerequisiteAction = "can_access" | ||
} | ||
persistent-disk = { | ||
actionPatterns = { | ||
can_access = { | ||
description = "necessary but not sufficient to perform any action on the persistent disk" | ||
} | ||
read = { | ||
description = "read metadata of persistent disk" | ||
} | ||
|
@@ -862,17 +878,27 @@ resourceTypes = { | |
} | ||
ownerRoleName = "creator" | ||
roles = { | ||
# the creator role is assigned directly to the persistent-disk resource and does not include can_access | ||
# but can_access is required to perform any action so must be granted via the parent resource using | ||
# either the manager or accessor role | ||
creator = { | ||
roleActions = ["read", "attach", "modify", "delete", "read_policies", "set_parent", "get_parent"] | ||
} | ||
manager = { | ||
roleActions = ["delete", "read", "read_policies"] | ||
roleActions = ["delete", "read", "read_policies", "can_access"] | ||
} | ||
accessor = { | ||
roleActions = ["can_access"] | ||
} | ||
} | ||
reuseIds = false | ||
prerequisiteAction = "can_access" | ||
} | ||
kubernetes-app = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, you were right, I missed it |
||
actionPatterns = { | ||
can_access = { | ||
description = "necessary but not sufficient to perform any action on the kubernetes app" | ||
} | ||
delete = { | ||
description = "delete kubernetes application" | ||
} | ||
|
@@ -901,11 +927,17 @@ resourceTypes = { | |
} | ||
ownerRoleName = "creator" | ||
roles = { | ||
# the creator role is assigned directly to the kubernetes-app resource and does not include can_access | ||
# but can_access is required to perform any action so must be granted via the parent resource using | ||
# either the manager or accessor role | ||
creator = { | ||
roleActions = ["delete", "connect", "update", "status", "stop", "start", "read_policies", "set_parent"] | ||
} | ||
accessor = { | ||
roleActions = ["can_access"] | ||
} | ||
manager = { | ||
roleActions = ["delete", "status", "read_policies"] | ||
roleActions = ["delete", "status", "read_policies", "can_access"] | ||
} | ||
} | ||
reuseIds = false | ||
|
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.
❤️