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

Can update a share of a file with a user to have only create or delete permission #2202

Closed
kiranparajuli589 opened this issue Jun 22, 2021 · 1 comment
Labels

Comments

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Jun 22, 2021

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. create two users uu1 and uu2
  2. upload a file lorem.txt using user uu`
  3. share file lorem.txt with user uu2 using user uu1
  4. accept the incoming share using user uu2
  5. edit the last created share permission to create only using user uu1
    curl -k -u uu1:uu1 https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/2205751e-290f-489a-8d40-bcf1f799ed0d
    

Expected behavior

In oc10 backend:
Request failed with ocs status code 400

Actual behavior

share update success:

<?xml version="1.0" encoding="UTF-8"?>
<ocs>
    <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message>OK</message>
    </meta>
    <data>
        <id>2205751e-290f-489a-8d40-bcf1f799ed0d</id>
        <share_type>0</share_type>
        <uid_owner>uu1</uid_owner>
        <displayname_owner>uu1</displayname_owner>
        <additional_info_owner>[email protected]</additional_info_owner>
        <permissions>4</permissions>
        <stime>1624358921</stime>
        <parent></parent>
        <expiration></expiration>
        <token></token>
        <uid_file_owner>uu1</uid_file_owner>
        <displayname_file_owner>uu1</displayname_file_owner>
        <additional_info_file_owner>[email protected]</additional_info_file_owner>
        <state>0</state>
        <path>/sub.txt</path>
        <item_type>file</item_type>
        <mimetype>text/plain</mimetype>
        <storage_id>1284d238-aa92-42ce-bdc4-0b0000009157</storage_id>
        <storage>0</storage>
        <item_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmM3ZDNhMGYzLTQ3YmYtNDQ0NS04ODAxLTY0ZDRkNjkwMThkNA==</item_source>
        <file_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmM3ZDNhMGYzLTQ3YmYtNDQ0NS04ODAxLTY0ZDRkNjkwMThkNA==</file_source>
        <file_parent></file_parent>
        <file_target>/sub.txt</file_target>
        <share_with>uu2</share_with>
        <share_with_displayname>uu2</share_with_displayname>
        <share_with_additional_info>[email protected]</share_with_additional_info>
        <mail_send>0</mail_send>
        <name></name>
    </data>
</ocs>

Setup

export OCIS_URL=https://localhost:9200
export STORAGE_HOME_DRIVER=$DRIVER
export STORAGE_USERS_DRIVER=$DRIVER
export STORAGE_DRIVER_OCIS_ROOT=/tmp/ocis/storage/users
export STORAGE_DRIVER_LOCAL_ROOT=/tmp/ocis/local/root
export STORAGE_METADATA_ROOT=/tmp/ocis/metadata
export STORAGE_DRIVER_OWNCLOUD_DATADIR=/tmp/ocis/owncloud/data
export STORAGE_HOME_DATA_SERVER_URL=http://localhost:9155/data
export STORAGE_USERS_DATA_SERVER_URL=http://localhost:9158/data
export STORAGE_SHARING_USER_JSON_FILE=/tmp/ocis/shares.json
export PROXY_ENABLE_BASIC_AUTH=True
export WEB_UI_CONFIG=$HOME/www/ocConfigs/ocis-config/ocis-config.json
export IDP_IDENTIFIER_REGISTRATION_CONF=$HOME/www/ocConfigs/ocis-config/idp.yml
export OCIS_LOG_LEVEL="error"
export SETTINGS_DATA_PATH=/tmp/ocis/settings

if [ $DRIVER == "owncloud" ]
then
	export STORAGE_DRIVER_OWNCLOUD_REDIS_ADDR=localhost:6379
else
	export STORAGE_DRIVER_OWNCLOUD_REDIS_ADDR=
fi

Additional context

Add any other context about the problem here.

@kiranparajuli589
Copy link
Contributor Author

already described in #2173

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

No branches or pull requests

1 participant