Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

feat: share group virtual folder directly without invitation #419

Merged
merged 17 commits into from
May 5, 2021

Conversation

adrysn
Copy link
Member

@adrysn adrysn commented Apr 13, 2021

This PR adds API endpoints to share or unshare a group virtual folder to users directly with overriding permission. This is to allow specified users (usually teachers with user account) can upload data/materials to a group virtual folder while it is shared as read-only for all other group users (usually students).

Also, query_accessible_vfolders are refactored to account for the overriding permission of group virtual folders.

Only group virtual folders are directly sharable since user-type folders can be shared by invitation. Group folders are visible to every group users without user's choice, so it does not make sense to invite a group folder.

adrysn added 3 commits April 13, 2021 23:12
…lders

Two queries, for user's own vfolders and invited vfolders, were able to be
merged as a single query.
@adrysn adrysn self-assigned this Apr 13, 2021
@adrysn adrysn added this to the 20.09 milestone Apr 13, 2021
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #419 (083abcd) into main (946000b) will increase coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 083abcd differs from pull request most recent head b58cf7c. Consider uploading reports for the commit b58cf7c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   48.86%   48.88%   +0.02%     
==========================================
  Files          52       52              
  Lines        8344     8326      -18     
==========================================
- Hits         4077     4070       -7     
+ Misses       4267     4256      -11     
Impacted Files Coverage Δ
src/ai/backend/manager/models/vfolder.py 40.50% <0.00%> (-0.83%) ⬇️
src/ai/backend/manager/server.py 59.00% <0.00%> (-0.75%) ⬇️
src/ai/backend/manager/models/base.py 53.80% <0.00%> (+0.29%) ⬆️
src/ai/backend/manager/api/auth.py 52.05% <0.00%> (+1.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 946000b...b58cf7c. Read the comment docs.

@adrysn adrysn changed the title feat: share vfolder directly without invitation feat: share group vfolder directly without invitation Apr 16, 2021
@adrysn adrysn changed the title feat: share group vfolder directly without invitation feat: share group virtual folder directly without invitation Apr 16, 2021
@adrysn adrysn modified the milestones: 20.09, 21.03 May 2, 2021
@adrysn adrysn merged commit 2da4605 into main May 5, 2021
@adrysn adrysn deleted the feat/api-to-share-vfolder-directly branch May 5, 2021 03:29
adrysn added a commit that referenced this pull request May 5, 2021
* feat: add API endpoint to share/unshare a vfolder to users

* refactor: make query_accessible_vfolders shorter for listing user vfolders

Two queries, for user's own vfolders and invited vfolders, were able to be
merged as a single query.

* Revert "refactor: make query_accessible_vfolders shorter for listing user vfolders"

This reverts commit b3a5076.

* fix: linting errors

* refactor: shorter codes for querying accessible user-type vfolders

* refactor: further shortening query accessible vfolders

* feat: override group vfolder's permission if it is shared by admin

* feat: prevent user-type vfolders from shared directly

User-type vfolders can be shared by invitation.

* Add news fragment

* refactor: raise exception when some of shared user does not belong to the group vfolder belongs to

* refactor: accept folder's name instead of id for client-py usability

* fix: respond with shared/unshared emails

* fix: correct display of group virtual folder's overriden permission

* feat: list_shared_folders now return information on group folders as well

* fix: do not share group vfolder to users who are not in the group

Co-authored-by: Joongi Kim <joongi@lablup.com>

Backported-From: main
Backported-To: 21.03
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants