Controlling Groupfolders from an App

I have written an NC app for handling processes in a small business and NC is also used for sharing project files in groupfolders. In order to bind management and files together I need to control file sharing from this app.

We have organized our NC files in two groupfolders, Archive and Pool. Files that we are working on are in project folders in Pool and get synchronized with the NC Deskop App to users in group Staff. Once work on a project is done the corresponding folder is moved into Archive from which no synchronization is performed.

Administration of groupfolders is delegated to a Control group. Manual control over shared files and folders is perfectly possible and includes the following operations which I would like to perform programmatically:

  1. create a groupfolder in Pool and set permissions to allow r/w access to Staff users
  2. remove permissions and move the groupfolder to Archive
    – or, should that not be feasible –
    move the contents of a groupfolder into a new folder in Archive and remove the groupfolder from Pool
  3. step 2. in reverse

There is no official groupfolder API but its behaviour appears to be controlled by Admin Settings. I came as far as getAllAllowedAdminSettings() for a user of the Control group but there seems to be no documented way of actually manipulating groupfolders via those settings.

–

In case you have a suggestion that does not involve groupfolders: it is a requirement that Staff users are kept from creating or deleting project folders in Pool or Archive. Inside a project folder in Pool their access is unlimited. Also, the file history of project folders moved between Pool and Archive must be conserved so that older file versions remain accessible.

I meanwhile found ways to control groupfolders via OCC or REST API (GitHub - nextcloud/groupfolders: πŸ“πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Admin-configured folders shared by everyone in a group. https://github.com/nextcloud-releases/groupfolders). REST is not great but doable from an app, so I guess my question has an answer.

However, I would have much preferred an answer that involves using a PHP API. If anybody out there has a suggestion in this direction I am still dying to hear it.

How about contacting the devs of the group folder app? They need to provide an API in order to affect their stuff…

The problem of inter-app communication has been addressed in the forum here already (search for one of my topics): There is no ultimative solution and must be constructed depending on the use-case.

Christian