-
Notifications
You must be signed in to change notification settings - Fork 21
Assign ownership details to a hierarchy of nodes #301
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
Create a separate model to store user information that will be accessible publicly and can be updated by user. Store private information along with profile to `User` model and only admins will be allowed to access/update it. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
`User` model has been restructured to have a user public profile in `User.profile` field. Use the field for the related changes in Authentication module. Authentication method `get_current_user` will need to get `User` object based on `profile`. For that, implement `Database.find_one_by_attributes` method to find user object matching username from user profile. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update `post_user` handler to create user profile object and use it to create user object. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update `post_node` handler to use user profile to get node owner's username. This change is due to restructuring user model with `UserProfile`. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update unit tests to accommodate changes in the `User` field related to user profile. Also, add mock function for `Database.find_one_by_attributes` and use it for token handler tests. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update `authorize_user` method to use user profile to get node owner's username and groups. This change is due to restructuring user model with `UserProfile`. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update e2e tests to accommodate changes in the `User` field related to user profile. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Update `setup_admin_user` method to use user profile to while creating admin user. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
When submitting a hierarchy of nodes using `put_nodes`, set node ownership information to all the nodes recursively. Also, use `authorize_user` method for user authorization upon receiving the request. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
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 don't think this depends on user profile changes, just the Node.owner field needs to be populated. Which model it's using doesn't make a difference, as far as I can tell.
Please see below line of change. It needs to have
|
Ah yes, thanks. Well if we don't have the UserProfile changes then we can just do |
Depends on #292 for user profile changes.
api.main: set node ownership to a hierarchy of nodes
When submitting a hierarchy of nodes using
put_nodes
, set node ownership information to all the nodes recursively.Also, use the
authorize_user
method for user authorization upon receiving the request.