-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Allow superadmins to list vfolders as specific user #544
Conversation
Codecov Report
@@ Coverage Diff @@
## main #544 +/- ##
==========================================
+ Coverage 49.13% 49.27% +0.14%
==========================================
Files 54 54
Lines 9031 9207 +176
==========================================
+ Hits 4437 4537 +100
- Misses 4594 4670 +76
Continue to review full report at Codecov.
|
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.
To keep consistency with owner_access_key
used in session APIs to delegate the identity, let's rename the new user argument as owner_user_email
.
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.
Q: Why not used query_accessible_vfolders()
with the target user UUID and role?
* Also reuse `query_accessible_vfolders()` for delegated queries
A: It is because double query is needed to know the target user UUID and role by only email. I thought this process cause performance degradation. |
That overhead is okay because it only fetches one row from a unique key. The |
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 fixed minor things to make list_folders()
function works fine.
"Only admins can perform operations on behalf of other users.", | ||
) | ||
else: | ||
owner_user_uuid = request['user']['uuid'] |
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 fixed this part since there's no user_uuid
or user_role
field in the request parameter.
Instead, we can use uuid
and role
field from user field in request.
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.
Thanks! 👍🏼
Let's deprecate the "all" option as it would incur severe performance overheads when used on the cloud. I will update the code. |
resolve: lablup/backend.ai#321
related: lablup/backend.ai-webui#1237
To solve the problem of webui, this is implemented in
list_folders
api. This feature uses only the user's email to search the folder of the user. Now only superadmin can use this feature, but it will be expandable like public/private folder option.It request to DB about vfolder informations belong to carried user email. The other process is same to existing folder listing feature.

When superadmin click checkbox and it is checked, webui request to manager this feature. Parameter is added 'user email'.