Skip to content

Conversation

@max-zilla
Copy link
Contributor

Similar to dataset, but inherits file role from the file's parent dataset.

Copy link
Contributor

@tcnichol tcnichol left a comment

Choose a reason for hiding this comment

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

These look good. I'll mark approved.

class AuthorizationFile(BaseModel):
# TODO: This should be PyObjectId = Field(default_factory=PyObjectId). Need to figure out why can't create instance
# in `routers.authorization.get_dataset_role()`.
file_id: str
Copy link
Member

Choose a reason for hiding this comment

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

I saw your todos.. could you make it ObjectID?

authorization = await db["authorization"].find_one(
{
"dataset_id": file_out.dataset_id,
"user_id": current_user,
Copy link
Member

Choose a reason for hiding this comment

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

This will work for now. Once we merge my pR, it won't work as we ll have a list of user_ids. I am thinking how to handle that.

Everything else looks okay.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I have used ObjectId for user_id as well.

@max-zilla max-zilla merged commit 40bf75f into main Mar 3, 2023
@max-zilla max-zilla deleted the add-file-endpoint-permissions branch March 3, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants