-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat(organizations): add new asset endpoint for owners and admins TASK-960 #5218
Conversation
…ion-assets-endpoint
…ion-assets-endpoint
…ion-assets-endpoint
…ion-assets-endpoint
…to support org admins
855905d
to
12a1425
Compare
…eting submissions
12a1425
to
58163fd
Compare
Few comments according to the new PR workflow:
|
@noliveleger should the |
@magicznyleszek , you are totally right, I fixed it. |
@noliveleger |
# Conflicts: # kpi/views/v2/asset_file.py
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.
LGTM
Summary:
Added a new endpoint to retrieve organization assets, accessible to both owners and admins.
Description:
This update introduces a dedicated endpoint that allows organization owners and admins to access a complete list of assets associated with their organization. Owners and admins have unrestricted access to these assets by virtue of their roles, without needing explicit permissions.
Notes:
As part of this update, a refactor was implemented in the unit test suite to minimize code duplication when testing organization admin access across various endpoints. This refactor allows us to test admin access without explicitly assigning permissions, ensuring that the tests more accurately reflect role-based access.
Testing
user2 is now an admin and should be able to see and to do whatever they want on user1's organization projects, they should be able to access the org assets list:
/api/v2/organizations/<organization_uid>/assets/
user3 is a regular member, they cannot access
/api/v2/organizations/<organization_uid>/assets/
organization_uid
can be retrieve from/me
inorganization
property.Create a project with user3
/api/v2/assets/
) and should have been assignedmanage_asset
permissionCreate a project with user2
manage_asset
permissionCreate a project with user1
By-pass front-end checks to allow org admins access project details
npm run watch
to compile front-end build on the fly (with kobo-install,./run.py -cf run -p 3000:3000 --rm kpi npm run watch
)When this work, you can test the admin role by navigating in the project detail. The API responses should always be
2xx
.