groupfolders
groupfolders copied to clipboard
Ability to change a regular folder to group folder directly and back
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)
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:
- Backup your database. This could get messy.
- 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 inoc_filecache
and cause key constraint issues.) - Update the folder's record in the
oc_filecache
table, so that thepath
is__groupfolders/GROUP_ID
,path_hash
is the value ofMD5('__groupfolders/GROUP_ID')
,name
isGROUP_ID
andstorage
is1
. e.g.
UPDATE oc_filecache SET path = '__groupfolders/10', path_hash = MD5('__groupfolders/10'), name = '10', storage = 1 WHERE fileid = FOLDER_ID;
- 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
- Move files from the user's profile directory into the group folder.
mv app/data/username/files/folder_name/* app/data/__groupfolders/10/
- All done!
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.
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.
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. :-(
Related: #458
Changed this issue to also handle the reverse case as they are probably best to implement together.
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.
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.
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.
@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.