nextcloud / groupfolders

๐Ÿ“๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Admin-configured folders shared by everyone in a group. https://github.com/nextcloud-releases/groupfolders
https://apps.nextcloud.com/apps/groupfolders
278 stars 85 forks source link

Ability to change a regular folder to group folder directly and back #612

Open joekerna opened 4 years ago

joekerna commented 4 years ago

Discussion started in nextcloud forum:

I think a nice feature would be to be able to change a regular folder into a group folder.

At the moment I have to create a new folder, move all data into it and then delete the old folder (that is automatically renamed to folder_1)

xtrasimplicity commented 3 years ago

Is there any interest in this feature, from the core team? Or is there a simple way to do this, whilst retaining all shares (for the folder itself, not subfolders/files), etc?

I've found a way, but it's a bit messy:

  1. Backup your database. This could get messy.
  2. Manually insert a new group folder into the oc_group_folders database table. (Don't create this via the GUI, as otherwise it will automatically create a record in oc_filecache and cause key constraint issues.)
  3. Update the folder's record in the oc_filecache table, so that the path is __groupfolders/GROUP_ID, path_hash is the value of MD5('__groupfolders/GROUP_ID'), name is GROUP_ID and storage is 1. e.g.
    UPDATE oc_filecache SET path = '__groupfolders/10', path_hash = MD5('__groupfolders/10'), name = '10', storage = 1 WHERE fileid = FOLDER_ID;
  4. Create a folder in app/data/__groupfolders to match the new group ID, and take ownership of the folder (to match the other group folders). e.g.
    mkdir app/data/__groupfolders/10
    chown www-data:www-data app/data/__groupfolders/10
    chmod 755 www-data:www-data app/data/__groupfolders/10
  5. Move files from the user's profile directory into the group folder.
    mv app/data/username/files/folder_name/* app/data/__groupfolders/10/
  6. All done!
markusdd commented 1 year ago

would like to mention we are interested in this as well.

Actually this is a pretty common use case for us where a small group starts with a shared folder and when a project actually kicks off we want to have the data properly managed by a Group Folder that gets shared more widely.

bernd-wechner commented 8 months ago

The lack of this is in fact a crisis to my mind. Would you believe that if you create a group folder with the name of an existing folder, that existing folder disappears? I have yet to work out the details as I stopped all clients immediately to inspect the impact on the server. Still doing that and it's danged cryptic.

thekk1 commented 6 months ago

I would support this feature. We have some group folders with many sub folders. If we want to give access to an, for example, external user to one of the sub directories, the external user can't access the sub directory because of lack to access the parent folder(s). If you allow access to the parent you have to actively disallow access to all current and future sibling folders. The only workaround is to create a new group folder with the name "root/subparent/subchild", give access to the external group, move all data to new group folder, inform all user that their links, shares, favorites and stuff are gone and create the parent folder path ("root/subparent") for each user in their personal space so they can access the sub child folder.

Some stuff is so hard in nextcloud just because they don't followed normal conventions on ACL stuff. :-(

joshtrichards commented 1 week ago

Related: #458

provokateurin commented 2 days ago

Changed this issue to also handle the reverse case as they are probably best to implement together.

markusdd commented 2 days ago

I would make the argument that 'group folders' should not really be a seperate thing altogether.

They should be able to live in any hierarchy and adding groups should work just like adding individuals.

provokateurin commented 2 days ago

I agree with you on a conceptual level, but the main problem is that as soon as it is a groupfolder the owner is no longer a user which is very different from most other files stuff.

bernd-wechner commented 1 day ago

I agree with you on a conceptual level, but the main problem is that as soon as it is a groupfolder the owner is no longer a user which is very different from most other files stuff.

With all due respect I see that as a meaningless red herring, a distraction of no consequence to the idea here. It seems bleedingly obvious that when you make a folder a group folder that people in that group have access to it.

The only utility I see this observation adding is that we should be aware that if making an existing folder a group folder, the original owner should be remembered, as the one person who can convert it back.

This is really just a subtle variant on the idea of sharing folders at present.

provokateurin commented 1 day ago

@bernd-wechner Maybe I wasn't clear enough: I totally agree that groupfolders is "just another sharing option" to regular users, but on a technical level in Nextcloud it is very different and thus it makese sense to not have it in the server directly. Let's stay on the topic of this issue though, it was acknowledged that this feature is needed and valid, so it will be implemented at some point.