<commit_before>@api @TestAlsoOnExternalUserBackend
Feature: sharing

  Background:
    Given using OCS API version "1"
    And using old DAV path
    And user "user0" has been created
    And user "user1" has been created

  @smokeTest
  Scenario: Correct webdav share-permissions for owned file
    Given user "user0" has uploaded file with content "foo" to "/tmp.txt"
    When user "user0" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"

  Scenario: Correct webdav share-permissions for received file with edit and reshare permissions
    Given user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "/tmp.txt" with user "user1"
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"

  Scenario: Correct webdav share-permissions for received group shared file with edit and reshare permissions
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 19       |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"

  Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
    Given user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "tmp.txt" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 3 |
    And user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"

  Scenario: Correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 3        |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"

  Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
    Given user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "tmp.txt" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 17 |
    And user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"

  Scenario: Correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 17       |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"

  Scenario: Correct webdav share-permissions for owned folder
    Given user "user0" has created a folder "/tmp"
    When user "user0" gets the following properties of folder "/" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"

  Scenario: Correct webdav share-permissions for received folder with all permissions
    Given user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"

  Scenario: Correct webdav share-permissions for received group shared folder with all permissions
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path      | tmp  |
      | shareType | 1    |
      | shareWith | grp1 |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"

  Scenario: Correct webdav share-permissions for received folder with all permissions but edit
    Given user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 29 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"

  Scenario: Correct webdav share-permissions for received group shared folder with all permissions but edit
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 29   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"

  Scenario: Correct webdav share-permissions for received folder with all permissions but create
    Given user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 27 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"

  Scenario: Correct webdav share-permissions for received group shared folder with all permissions but create
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 27   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"

  Scenario: Correct webdav share-permissions for received folder with all permissions but delete
    Given user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 23 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"

  Scenario: Correct webdav share-permissions for received group shared folder with all permissions but delete
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 23   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"

  Scenario: Correct webdav share-permissions for received folder with all permissions but share
    Given user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 15 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"

  Scenario: Correct webdav share-permissions for received group shared folder with all permissions but share
    Given group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 15   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"<commit_msg>Use both webDAV paths for share permission Acceptance tests<commit_after>@api @TestAlsoOnExternalUserBackend
Feature: sharing

  Background:
    Given using OCS API version "1"
    And user "user0" has been created
    And user "user1" has been created

  @smokeTest
  Scenario Outline: Correct webdav share-permissions for owned file
    Given using <dav-path> DAV path
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    When user "user0" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received file with edit and reshare permissions
    Given using <dav-path> DAV path
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "/tmp.txt" with user "user1"
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared file with edit and reshare permissions
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 19       |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
    Given using <dav-path> DAV path
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "tmp.txt" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 3 |
    And user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 3        |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
    Given using <dav-path> DAV path
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has shared file "tmp.txt" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 17 |
    And user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has uploaded file with content "foo" to "/tmp.txt"
    And user "user0" has created a share with settings
      | path        | /tmp.txt |
      | shareType   | 1        |
      | permissions | 17       |
      | shareWith   | grp1     |
    When user "user1" gets the following properties of file "/tmp.txt" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for owned folder
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    When user "user0" gets the following properties of folder "/" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received folder with all permissions
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path      | tmp  |
      | shareType | 1    |
      | shareWith | grp1 |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received folder with all permissions but edit
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 29 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but edit
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 29   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received folder with all permissions but create
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 27 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but create
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 27   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received folder with all permissions but delete
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 23 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but delete
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 23   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received folder with all permissions but share
    Given using <dav-path> DAV path
    And user "user0" has created a folder "/tmp"
    And user "user0" has shared file "/tmp" with user "user1"
    When user "user0" updates the last share using the sharing API with
      | permissions | 15 |
    And user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"
    Examples:
      | dav-path |
      | old      |
      | new      |

  Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but share
    Given using <dav-path> DAV path
    And group "grp1" has been created
    And user "user1" has been added to group "grp1"
    And user "user0" has created a folder "/tmp"
    And user "user0" has created a share with settings
      | path        | tmp  |
      | shareType   | 1    |
      | shareWith   | grp1 |
      | permissions | 15   |
    When user "user1" gets the following properties of folder "/tmp" using the WebDAV API
      | {http://open-collaboration-services.org/ns}share-permissions |
    Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"
    Examples:
      | dav-path |
      | old      |
      | new      |
{'fraction_non_alphanumeric': 0.0846956864289935, 'fraction_numerical': 0.013157376403387827, 'mean_word_length': 2.9345939243645383, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '682351', 'n_tokens_mistral': 7294, 'n_tokens_neox': 7058, 'n_words': 2828}