Automatically organize incoming shares in directories

When working with a lot of automated group shared directories it’s a bit messy that all new incoming shares for a user are going to be located within users root folder.

Is there a way or a plugin available, which allowes (by using some kind of configuration) automatically moving incoming shares for users (share via group) into a specific subfolder and not keep them on user’s root level?

More detailed explenation

Setup & Requirements
Think of Alice who is sharing 3 folders /project1-a, /project1-b and /project1-c right now with Bob via Group assignments. It is important to keep in mind, that Alice is doing this very often with a lot of folders, which means she is sharing eg. 150 directories with others (via groups) [R1]. As Bob is part of a lot of these groups, he has access to eg. 100 directories shared by Alice, some with read/write-access, some with read-access only [R2]. It is important for this use case, that Bob also receives shares from other users as well [R3]. Bob is accessing the files and directories only via a WebDav protocol [R4]. Alice is not creating the shares manually, but actually needs to use some HTTP-API provided by Nextcloud (for shares this is WebDAV and some nextcloud/owncloud specific sharing api /ocs/v2.php/apps/files_sharing/api/v1/) [R5]. As time passes, Alice will remove access for bob via shares for some folders, or change his permission to read access only.

Current situation
At the moment, all new shares Bob receives appear in his root folder. So /project1-a, /project1-b and /project1-c will appear in his root folder besides all other shares possibly from other users.

Goals
In order to be able to keep overview on the files, the shares need to be structured in some kind of way. The most simply would be, that the shared directory are put inside a folder per owning user, so bob would have the directories project1-a, project1-b and project1-c put inside directory /alice on his root level (as full path, /alice/project1-a, /alice/project1-b, /alice/project1-c). This makes him able to easier distinguish by shares from different users (keep in mind he’s using webDAV, R4). [G1]

It would be even better for bob, if there would be a more complex ruleset on how these directories are organised available. So for example, as the directories shared right now have the same prefix project1 in common, they could be placed inside /alice/project1- (as full path, /alice/project1-/a, /alice/project1-/b, /alice/project1-/c). [G2]

The following parameter exists in the Nextcloud server Konfiguration which allows to define a general directory in which all shared folders are shown in your personal context. Unfortunately I’m not aware about any personal setting to set this parameter yet.

 'share_folder' => '/shared_data_folder',
1 Like

Thank you for your reply, I’m aware of this setting. I was thinking more about something more customizable, for example to make it dependant who created the share. If there’s nothing like this available yet, it might be possible to implement it using app flows.

You can add shares also from users of other nextclouds (federation). I think your issue makes less sense.
If you use a lot of shares perhaps you must minimize it. Perhaps with “group folder”.

Thanks devnull for having a look on my issue and your input.

I’m sorry, my explanation must have been misleading. I’m trying to explain using an example.

Setup & Requirements
Think of Alice who is sharing 3 folders /project1-a, /project1-b and /project1-c right now with Bob via Group assignments. It is important to keep in mind, that Alice is doing this very often with a lot of folders, which means she is sharing eg. 150 directories with others (via groups) [R1]. As Bob is part of a lot of these groups, he has access to eg. 100 directories shared by Alice, some with read/write-access, some with read-access only [R2]. It is important for this use case, that Bob also receives shares from other users as well [R3]. Bob is accessing the files and directories only via a WebDav protocol [R4]. Alice is not creating the shares manually, but actually needs to use some HTTP-API provided by Nextcloud (for shares this is WebDAV and some nextcloud/owncloud specific sharing api /ocs/v2.php/apps/files_sharing/api/v1/) [R5]. As time passes, Alice will remove access for bob via shares for some folders, or change his permission to read access only.

Current situation
At the moment, all new shares Bob receives appear in his root folder. So /project1-a, /project1-b and /project1-c will appear in his root folder besides all other shares possibly from other users.

Goals
In order to be able to keep overview on the files, the shares need to be structured in some kind of way. The most simply would be, that the shared directory are put inside a folder per owning user, so bob would have the directories project1-a, project1-b and project1-c put inside directory /alice on his root level (as full path, /alice/project1-a, /alice/project1-b, /alice/project1-c). This makes him able to easier distinguish by shares from different users (keep in mind he’s using webDAV, R4). [G1]

It would be even better for bob, if there would be a more complex ruleset on how these directories are organised available. So for example, as the directories shared right now have the same prefix project1 in common, they could be placed inside /alice/project1- (as full path, /alice/project1-/a, /alice/project1-/b, /alice/project1-/c). [G2]

But I assume, that it’s not very likely that these goals G1 or G2 can be achieved using available mechanisms/plugins while satisfying requirements R1-R5.

Please validate again, if this can be achieved using federation share. From what I understood what they don’t help here, but I might be wrong.

Changing the use case is not a solution, unfortunately.

They don’t appeal to be useful here to me, as they also appear in a user’s root folder when they get access to it same as shares do. I also think they are managed globally and not per user, which would make other admins able to mess up the group directories created by Alice, as far as I can see.

So please, I’m open to suggestions, if there are solutions available yet or if someone can at least imagine that this could be implemented with some kind of “flow” type “app”/plugin.