nextcloud / groupfolders

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

Adding multiple permissions to groups via OCC CLI not possible #2285

Open christianlupus opened 1 year ago

christianlupus commented 1 year ago

How to use GitHub

Steps to reproduce

  1. Create test groups A and B and a group folder with group A attached and B not attached
  2. Go to the CLI of the NC installed
  3. Try to add group B using occ with read, write, share, and delete permissions

Expected behaviour

I can add the group and the group is added to the group list. The settings in the web frontend represent the changes.

Actual behaviour

There is no description on how the permission string should be parsed in the help of the command.

Adding a user with a single permission (like write) works. As soon as two permissions are considered, the error message is

Cannot parse permission input

Server configuration

Operating system: Linux

Web server: Apache (from official docker image)

Database: MariaDB

PHP version: 8.1 (?) (from docker image)

Nextcloud version: 25.0.4

Group folders version: 13.1.1

Updated from an older Nextcloud/ownCloud or fresh install: upgraded

Where did you install Nextcloud from: Docker

Are you using external storage, if yes which one: local

Are you using encryption: no

Are you using an external user-backend, if yes which one: only internal user backend

Additional information

According to these lines, the command takes a single string parameter. However the implementation assumes the string to be an array.

My suggestion is to use some regex logic to split at all commas and spaces before iterating over the array. I can provide a PR if requested but wanted to avoid redundant work.

provokateurin commented 2 months ago

https://github.com/nextcloud/groupfolders/blob/359fd4105e426cdd5e9346e774d78001fac79e9e/lib/Command/ACL.php#L142-L161 is the code that parses the permissions given in the CLI, but I agree there should be documentation on this.