Skip to content

Conversation

@tcnichol
Copy link
Contributor

Modeled after Max's pull request. Checks authorization of metadata based on either file or dataset.

@tcnichol tcnichol requested a review from max-zilla as a code owner February 28, 2023 19:08
@tcnichol tcnichol linked an issue Feb 28, 2023 that may be closed by this pull request
@tcnichol tcnichol requested a review from lmarini February 28, 2023 19:08
@tcnichol tcnichol added this to the Sprint Mar 2 2023 milestone Mar 1, 2023
@ddey2
Copy link
Member

ddey2 commented Mar 2, 2023

Need to be updated after #354 gets merged

@tcnichol
Copy link
Contributor Author

tcnichol commented Mar 6, 2023

Will update once that is merged.

tcnichol added 3 commits March 6, 2023 15:11
# Conflicts:
#	backend/app/deps/authorization_deps.py
#	backend/app/routers/authorization.py
Copy link
Contributor

@max-zilla max-zilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple comments for clarification

async def get_metadata_role(
metadata_id: str,
current_user=Depends(get_current_username),
role: RoleType = Depends(get_role_by_file),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be get_role_by_metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

async for md in db["metadata"].find(query):
md_out = MetadataOut.from_mongo(md)
resource_type = md_out.resource.collection
resource_id = md_out.resource.resource_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@max-zilla max-zilla merged commit 5ccef9f into main Mar 8, 2023
@max-zilla max-zilla deleted the 358-add-metadata-authorization branch March 8, 2023 19:53
longshuicy pushed a commit that referenced this pull request Mar 13, 2023
* adding wrapper for metadata authorization

* formatting

* using pyobjectid not str

* merge,adding for metadata

* formatting

* small fixes based on max's comments

* formatting
max-zilla added a commit that referenced this pull request Mar 15, 2023
* tests

* skeleton code

* codegen

* connect to get role endpoint in redux

* add role chip

* add to file; but need to investigate why backend file doesn't work

* implement some basic role

* break action menu into owner, editor, upload

* add 403 page

* still falls to not found

* add metadata auth framework. (#359)

* adding wrapper for metadata authorization

* formatting

* using pyobjectid not str

* merge,adding for metadata

* formatting

* small fixes based on max's comments

* formatting

* adding restart unless stopped for this container (#341)

* Implement FileAuthorization dependency (#385)

* add FileAuthorization dependency

* formatting

* adjust permissions to uploader for a couple routes

---------

Co-authored-by: toddn <[email protected]>

* codgen

* write auth wrapper pattern

* fix file role

* temp fix for 403

* add protection on file menu

* add protection on file

* remove extraneous role filter on user roles

---------

Co-authored-by: Todd Nicholson <[email protected]>
Co-authored-by: Max Burnette <[email protected]>
Co-authored-by: toddn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

add metadata authorization

4 participants