-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix permission issues #155
base: dev
Are you sure you want to change the base?
Conversation
This was due to incorrect positions of parameters passed to the `get_user_permission` function. Also fix error when anon user tries to access the myorganisation page.
"""Get user's highest role across project's organisations""" | ||
""" | ||
Get user's highest role across project's organisations | ||
TODO: this assuming a project can be linked to multiple organisations, check if still the case |
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.
Is this still true?
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.
@yld-weng Thanks for this Yuliang. From my understanding, a project should only be linked to one org. But the PI (and their team) should have access to all projects/orgs who agree to share their data with us.
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.
Also just to clarify - all managers in a given organisation should have access to all of the org's projects.
@@ -63,7 +66,7 @@ def can_edit(self, user: User, project: Project) -> bool: | |||
if role == ROLE_ADMIN: | |||
return True | |||
elif role == ROLE_PROJECT_MANAGER: | |||
permission = self.get_user_permission(project, user) | |||
permission = self.get_user_permission(user, project) |
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.
Fix for #102.
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.
@yld-weng Apart from my comment above re. the PI's admin access, everything else looks good. Thanks
This PR primarily addresses permission issues and includes some basic documentation.
Related issues: #93, #78, and #102 (fixed).