-
Notifications
You must be signed in to change notification settings - Fork 6
Add File authorization framework #357
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
Conversation
tcnichol
left a comment
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.
These look good. I'll mark approved.
backend/app/models/authorization.py
Outdated
| 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 |
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 saw your todos.. could you make it ObjectID?
| authorization = await db["authorization"].find_one( | ||
| { | ||
| "dataset_id": file_out.dataset_id, | ||
| "user_id": current_user, |
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.
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.
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.
Yes, I have used ObjectId for user_id as well.
Similar to dataset, but inherits file role from the file's parent dataset.