groupfolders icon indicating copy to clipboard operation
groupfolders copied to clipboard

Clients shall be able to list all their groupfolders

Open tobiasKaminsky opened this issue 2 years ago โ€ข 12 comments

As we want to make groupfolders more visible, clients need an API to have all groupfolders listed. As groupfolders are folders, I think best is to have output similar to webdav results.

So either we have a separate API within groupfolders, or we extend webdav SEARCH to be able to retrieve (in a fast way) all groupfolders.

https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/search.html#supported-dav-properties

  • [x] Web https://github.com/nextcloud/groupfolders/pull/2326
  • [ ] extend API documentation if needed

tobiasKaminsky avatar Apr 05 '23 14:04 tobiasKaminsky

@icewind1991 as you have also in depth knowledge on search (performance), can you judge what is easier?

tobiasKaminsky avatar Apr 05 '23 14:04 tobiasKaminsky

A dav endpoint probably makes the most sense

icewind1991 avatar Apr 11 '23 12:04 icewind1991

I think a capability, indicating if current user has any groupfolders set up, is needed. As then clients can directly show/hide groupfolder entry (same for web). Or do we want to have this always visible and then "no groupfolders set up"?

As this is probably only useful for bigger instances/company, it would clutter interface. What do you think? @jancborchardt

tobiasKaminsky avatar Apr 11 '23 14:04 tobiasKaminsky

Yeah if no groupfolders are set up it does not make sense to show an entry. Reason being that regular accounts can not create any, only admins can.

jancborchardt avatar Apr 11 '23 14:04 jancborchardt

A dav endpoint probably makes the most sense

How will this then work? Will same folder /groupfolder in files and groupfolders endpoint have the same info and ids? Currently none of our clients have option to "browse" another endpoint.

To save time on clients, I think it must be either in existing webdav, or it is just a folder list within groupfolder API. This can then be retrieved and shown to user. Upon click of such an entry clients can browse to this path, using normal webdav.

tobiasKaminsky avatar Apr 12 '23 06:04 tobiasKaminsky

I spoke with Desktop and a separate webdav endpoint is also too much overhead on their side.

I think it is best to extend current API to also list info for non-admin:

curl --request GET \
  --url 'http://localhost/nc/index.php/apps/groupfolders/folders?format=json' \
  --header 'OCS-APIRequest: true' \

Result is:

{
	"ocs": {
		"meta": {
			"status": "ok",
			"statuscode": 100,
			"message": "OK",
			"totalitems": "",
			"itemsperpage": ""
		},
		"data": {
			"1": {
				"id": 1,
				"mount_point": "subfolder\/groupFolder",
				"groups": {
					"e2e": 31
				},
				"quota": -3,
				"size": 0,
				"acl": false,
				"manage": []
			}
		}
	}
}

Resuilt is a bit too much overhead for us, but to simplify it on app side, it is okay to have this, as we then simply ignore it :)

tobiasKaminsky avatar Apr 12 '23 09:04 tobiasKaminsky

https://github.com/nextcloud/groupfolders/pull/2327 adds non-admin access to the current API.

I was already mostly done with the DAV api before reading the above: https://github.com/nextcloud/groupfolders/pull/2326

icewind1991 avatar Apr 12 '23 13:04 icewind1991

I was already mostly done with the DAV api before reading the above: #2326

I am really sorry :S

tobiasKaminsky avatar Apr 12 '23 13:04 tobiasKaminsky

I think a capability, indicating if current user has any groupfolders set up, is needed.

Yeah if no groupfolders are set up it does not make sense to show an entry. Reason being that regular accounts can not create any, only admins can.

@icewind1991 can you add such capability? Something like:

"groupfolders": {
"hasAccessibleFolders": "true|false"
}

tobiasKaminsky avatar Apr 13 '23 07:04 tobiasKaminsky

@icewind1991 can you add such capability?

https://github.com/nextcloud/groupfolders/pull/2328

icewind1991 avatar Apr 13 '23 14:04 icewind1991

extend API documentation if needed

anything that needs to be done here @icewind1991 ? If no please tick the box, else a docs PR is needed. Thanks in advance

AndyScherzinger avatar May 10 '23 07:05 AndyScherzinger

It seems there were two new endpoints after the PR:

https://github.com/nextcloud/groupfolders/blob/691b04cb52b197c79787973442c092ce6ad99168/lib/DAV/PropFindPlugin.php#L22

https://github.com/nextcloud/groupfolders/blob/691b04cb52b197c79787973442c092ce6ad99168/lib/DAV/PropFindPlugin.php#L23

But documentation does not mention these.

Ornanovitch avatar Sep 12 '24 08:09 Ornanovitch

@tobiasKaminsky I think we can close this now?

provokateurin avatar Oct 08 '24 20:10 provokateurin