Repository navigation
Closed
Labels
Description
While creating the share if we dont specify the permission, it doesn't use one by default.
e.g.
no permission specified
❯ curl -k -u tu1:1234 -XPOST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -d path=file.txt -d shareType=3 -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9140...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9140 (#0)
* Server auth using Basic with user 'tu1'
> POST /ocs/v1.php/apps/files_sharing/api/v1/shares HTTP/1.1
> Host: localhost:9140
> Authorization: Basic dHUxOjEyMzQ=
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 25
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 25 out of 25 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Vary: Origin
< X-Access-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNTkzNDkyMDgyLCJpYXQiOjE1OTM0ODg0ODIsImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJ1c2VyIjp7ImlkIjp7ImlkcCI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJvcGFxdWVfaWQiOiJ0dTEifSwidXNlcm5hbWUiOiJ0dTEiLCJtYWlsIjoidHUxQGV4YW1wbGUub3JnIn19.fqJ5XmRG-t7ea_9v3-0CWKCtzaQQcQkZ1l7h2feGKac
< Date: Tue, 30 Jun 2020 03:41:22 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
With permission specified
❯ curl -k -u tu1:1234 -XPOST http://localhost:9140/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=4 -d path=file.txt -d shareType=3 -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9140...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9140 (#0)
* Server auth using Basic with user 'tu1'
> POST /ocs/v1.php/apps/files_sharing/api/v1/shares HTTP/1.1
> Host: localhost:9140
> Authorization: Basic dHUxOjEyMzQ=
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 39
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 39 out of 39 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Vary: Origin
< X-Access-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNTkzNDkxOTk5LCJpYXQiOjE1OTM0ODgzOTksImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJ1c2VyIjp7ImlkIjp7ImlkcCI6Imh0dHBzOi8vbG9jYWxob3N0OjkyMDAiLCJvcGFxdWVfaWQiOiJ0dTEifSwidXNlcm5hbWUiOiJ0dTEiLCJtYWlsIjoidHUxQGV4YW1wbGUub3JnIn19.MlE5MG05XBEBEQga_xvrpK0ukjM6915vB7LYl62gric
< Date: Tue, 30 Jun 2020 03:40:00 GMT
< Content-Length: 1030
< Content-Type: text/xml; charset=utf-8
<
<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>ok</status><statuscode>100</statuscode><message>OK</message></meta><data><id>BRvCKVOuHfyS</id><share_type>3</share_type><uid_owner>tu1@https://localhost:9200</uid_owner><displayname_owner></displayname_owner><permissions>4</permissions><stime>1593488400</stime><parent></parent><expiration></expiration><token>suECupWuxgDD</token><uid_file_owner>tu1</uid_file_owner><displayname_file_owner></displayname_file_owner><additional_info_owner></additional_info_owner><additional_info_file_owner></additional_info_file_owner><state>0</state><path>/file.txt</path><item_type>file</item_type><mimetype>application/octet-stream</mimetype><storage_id>1284d238-aa92-42ce-bdc4-0b0000009158</storage_id><storage>0</storage><item_source>394600120320</item_source><file_source>394600120320</file_source><file_parent></file_parent><file_target>/file.txt</file_target><share_with_additional_info></share_with_additional_info><mail_send></mail_send><url>/#/s/suECupWuxgDD</url></data>* Connection #0 to host localhost left intact
</ocs>%
Activity
[-][EOS] share not created with default permissions[/-][+]Share not created with default permissions[/+]jasson99 commentedon Apr 15, 2021
The behaviour now seems to be a bit different.
No permission specified:
curl -k -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d path=file.txt -d shareType=3 -u tu1:1234 |xmllint --format -Permissions specified:
curl -k -u tu1:1234 -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=3 -d path=file.txt -d shareType=3 |xmllint --format -curl -k -u tu1:1234 -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=15 -d path=file.txt -d shareType=3 |xmllint --format -curl -k -u tu1:1234 -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=4 -d path=file.txt -d shareType=3 |xmllint --format -jasson99 commentedon Apr 21, 2021
Description:
Different share permissions have varying role in core and ocis
In OC10:
Create a share with permissions
31or default has role specified asEditor.curl -k -X POST http://localhost/oc/ocs/v2.php/apps/files_sharing/api/v1/shares\?format\=json -d path="new new" -d shareWith="test123" -d permissions=31 -d shareType="0" -u admin:admin -v;Create a share with permissions
1has role specified asAdvanced Permissionscurl -k -X POST http://localhost/oc/ocs/v2.php/apps/files_sharing/api/v1/shares\?format\=json -d path="new new" -d shareWith="test123" -d permissions=1 -d shareType="0" -u admin:admin -v;Create a share with permissions
17has role specified asViewercurl -k -X POST http://localhost/oc/ocs/v2.php/apps/files_sharing/api/v1/shares\?format\=json -d path="new new" -d shareWith="test123" -d permissions=17 -d shareType="0" -u admin:admin -v;In OCIS:
Create a share with permissions
31or default has role specified asAdvanced Permissions.curl -k -u admin:admin -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=31 -d path="new new" -d shareType=0 -d shareWith="user1" |xmllint --format -Create a share with permissions
1has role specified asViewercurl -k -u admin:admin -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=1 -d path="new new" -d shareType=0 -d shareWith="user1" |xmllint --format -Create a share with permissions
17has role specified asAdvanced Permissionscurl -k -u admin:admin -X POST https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares -d permissions=17 -d path="new new" -d shareType=0 -d shareWith="user1" |xmllint --format -kiranparajuli589 commentedon Jun 20, 2022
The behavior has evolved now behaving as:
Link shares1Viewerrole assigned3provided with payload -> share is created with the same permission -> UI shows theEditorrole assigned4or15or17or31provided with payload -> share is not created -> message:unknown share typesUser shares19Editorrole assigned1provided -> share created with permission1-> UI shows theCustom Permissionsrole assigned3provided -> share created with permission3-> UI shows theCustom Permissionsrole assigned4provided -> share is not created -> message:[400]Cannot set the requested share permissions15provided -> share created with permission3-> UI shows theCustom Permissionsrole assigned17provided -> share created with permission17-> UI shows theViewerrole assigned19provided -> share created with permission19-> UI shows theEditorrole assigned31provided -> share created with permission19-> UI shows theEditorrole assignedkiranparajuli589 commentedon Jun 21, 2022
After owncloud/web#7136, a lot of the tagged scenarios have been removed.
QA-Team Todo:
saw-jan commentedon Jun 21, 2022
Also, it would be nice to see if this issue can be closed
amrita-shrestha commentedon Jun 22, 2022
Creating share without specific permission, create user-share with default permission 31 and public-share with default permission 1.That's a actual behavior
In ocis, the behavior has evolved now behaving as:
Link shares1(default permission for public-link share)Viewerrole assigned2provided -> htpp status code400-> message:Could not read permission from request3provided with payload -> share is created with the same permission -> UI shows [ocis] Shares sidebar does not show created public-link withPermission 3web#71644provided -> share created with permission4-> UI shows theUploaderrole assigned15provided -> share created with permission15-> UI shows theEditorrole assigned17provided -> htpp status code400-> message:Could not read permission from request31provided -> share created with permission1-> UI shows theViewerrole assignedUser shares31(default permission for user-share)Editorrole assigned1provided -> share created with permission1-> UI shows theCustom Permissions(read)role assigned2provided -> share created with permission2-> UI shows theCustom Permissions(Update)role assigned3provided -> share created with permission3-> UI shows theCustom Permissionsrole assigned (read, update)4provided ->share created with permission4-> UI shows theCustom Permissions(create)role assigned5provided ->share created with permission5-> UI shows theCustom Permissions(read,create)role assigned6provided -> share created with permission6-> UI shows theCustom Permissions(Update,create)role assigned7provided -> share created with permission3-> UI shows theCustom Permissionsrole assigned (read, update,create)15provided -> share created with permission15-> UI shows theCustom Permissionsrole assigned (read, update,create, delete )17provided -> share created with permission17-> UI shows theViewerrole assigned19provided -> share created with permission19-> UI shows theCustom Permissionsrole assigned(read, update, share)31provided -> share created with permission31-> UI shows theEditorrole assignedamrita-shrestha commentedon Jun 24, 2022
This issue has been solved but there are many scenarios under this issue in the expected failure list. Need a lot of changes on that scenario to pass. Should be discussed first Is it worth investing time in such a task. Until any decision is made transfered into the backlog.
SwikritiT commentedon Jul 6, 2022
This issue no longer exists so closing. There are some tests linked to this issue in expected to fail which will be handled in different PR https://github.com/owncloud/web/blob/67458fceb836429e9f2091b65d25ef42664064db/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md?plain=1#L161
SwikritiT commentedon Jul 8, 2022
follow up PR for expected to fail here owncloud/web#7246