Skip to content

Commit

Permalink
Merge pull request #814 from shangyian/fix-access-control
Browse files Browse the repository at this point in the history
  • Loading branch information
shangyian authored Oct 10, 2023
2 parents 85f0083 + 311e211 commit d48f136
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion datajunction-clients/python/datajunction/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Version for Hatch
"""
__version__ = "0.0.1a20"
__version__ = "0.0.1a22"
2 changes: 1 addition & 1 deletion datajunction-server/datajunction_server/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Version for Hatch
"""
__version__ = "0.0.1a26"
__version__ = "0.0.1a29"
21 changes: 14 additions & 7 deletions datajunction-server/datajunction_server/models/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,23 @@ def validate_access_nodes(
validation_results = access_control.validate()
if raise_:
access_control.raise_if_invalid_requests() # pragma: no cover

approved_node_ids = {
request.access_object.id for request in validation_results if request.approved
}
approved_node_revision_ids = {
request.access_object.revision_id
for request in validation_results
if request.approved
}
return [
node
for node in nodes
if node.id
in {
request.access_object.revision_id
for request in validation_results
if request.approved
}
if (
(isinstance(node, Node) and node.id in approved_node_ids)
or (
isinstance(node, NodeRevision) and node.id in approved_node_revision_ids
)
)
]


Expand Down
2 changes: 1 addition & 1 deletion datajunction-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datajunction-ui",
"version": "0.0.1-rc.21",
"version": "0.0.1-rc.25",
"description": "DataJunction Metrics Platform UI",
"module": "src/index.tsx",
"repository": {
Expand Down

0 comments on commit d48f136

Please sign in to comment.