owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.4k stars 182 forks source link

Space Managers can not edit shares #4384

Closed micbar closed 2 years ago

micbar commented 2 years ago

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create Space mars as Admin and share with Marie as "Manager"
  2. Create File Neue Datei.xlsx and share it with moss with editor grants
  3. Log in as Marie
  4. Edit the share on Neue Datei.xlsx with moss

Expected behavior

Actual behavior

1660215601371

Failing request

curl 'https://ocis.ocis-wopi.latest.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares/06bfe75e-a5ce-40e3-9710-629192d465a7' \
  -X 'PUT' \
  -H 'authority: ocis.ocis-wopi.latest.owncloud.works' \
  -H 'accept: */*' \
  -H 'accept-language: de-DE,de;q=0.9' \
  -H 'authorization: Bearer XXX \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'ocs-apirequest: true' \
  -H 'origin: https://ocis.ocis-wopi.latest.owncloud.works' \
  -H 'referer: https://ocis.ocis-wopi.latest.owncloud.works/files/spaces/projects/1284d238-aa92-42ce-bdc4-0b0000009157$3449df55-e18a-4aed-92e0-2c8cadcc10b9?sort-by=name&sort-dir=asc&items-per-page=100' \
  -H 'sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' \
  -H 'x-request-id: ca2e6285-b7de-4ec5-997b-58fff946d7d0' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw 'permissions=19&expireDate=&role=editor' \
  --compressed

Response

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>998</statuscode><message>cant find requested share</message></meta></ocs>

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

```console OCIS_XXX=somevalue OCIS_YYY=somevalue PROXY_XXX=somevalue ```

Additional context

Add any other context about the problem here.

micbar commented 2 years ago

@kulmann It seems to me that web is not checking the ocs response body for errors.

C0rby commented 2 years ago

WIP note: We need to add an extra Stat request to GetShare. This currently doesn't work because the gatewayclient configured in the cs3 share manager is that of the storage-system service which uses the static storage registry. What we want is to send the stat requests to the gateway at ":9142".

C0rby commented 2 years ago

Fixed via https://github.com/owncloud/ocis/pull/4539