Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document new share attributes and the "download" permission #9186

Closed
PVince81 opened this issue Sep 28, 2022 · 3 comments · Fixed by #9518
Closed

Document new share attributes and the "download" permission #9186

PVince81 opened this issue Sep 28, 2022 · 3 comments · Fixed by #9518
Assignees

Comments

@PVince81
Copy link
Member

Ref nextcloud/server#32482

curl -u admin:admin 'https://domain.tld/ocs/v2.php/apps/files_sharing/api/v1/shares/$shareId` \
  -X 'PUT' \
  -H 'OCS-APIRequest: true' \
-H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json' \
  --data-raw '{"attributes":[{"scope": "permissions", "key": "download", "enabled": "false"}]}'
@PVince81
Copy link
Member Author

PVince81 commented Jan 4, 2023

PR here: #9518

@xeruf
Copy link

xeruf commented Mar 30, 2023

Is there any way to create a link with this attribute set via curl and not have to make a separate PUT request?
Checked the docs but got nothing the like to work:

curl ... -X POST -d 'path=/DIR&shareType=3&permissions=1&publicAccess=1&expireDate=2023-04-15&attributes=[{"scope":"permissions","key":"download","enabled":false}]'

https://docs.nextcloud.com/server/stable/developer_manual/client_apis/OCS/ocs-share-api.html#share-attributes

@xeruf
Copy link

xeruf commented Mar 30, 2023

Not even working with what you posted :/

❯ curl -u admin:PWD 'https://DOMAIN/ocs/v2.php/apps/files_sharing/api/v1/shares/ID' -X 'PUT' -H 'OCS-APIRequest: true' -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json' --data-raw '{"attributes":[{"scope": "permissions", "key": "download", "enabled": "false"}]}'
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>500</statuscode>
  <message>Internal Server Error
OCA\Files_Sharing\Controller\ShareAPIController::updateShare(): Argument #10 ($attributes) must be of type ?string, array given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 225 in file '/var/www/html/apps/files_sharing/lib/Controller/ShareAPIController.php' line 1069</message>
 </meta>
 <data/>
</ocs>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants