sharing-v1-part4.feature 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. Feature: sharing
  2. Background:
  3. Given using api version "1"
  4. Given using new dav path
  5. # See sharing-v1-part3.feature
  6. Scenario: Creating a new share of a file shows size and mtime
  7. Given user "user0" exists
  8. And user "user1" exists
  9. And As an "user0"
  10. And parameter "shareapi_default_permissions" of app "core" is set to "7"
  11. When creating a share with
  12. | path | welcome.txt |
  13. | shareWith | user1 |
  14. | shareType | 0 |
  15. And the OCS status code should be "100"
  16. And the HTTP status code should be "200"
  17. And Getting info of last share
  18. Then the OCS status code should be "100"
  19. And the HTTP status code should be "200"
  20. And Share fields of last share match with
  21. | item_size | A_NUMBER |
  22. | item_mtime | A_NUMBER |
  23. Scenario: Creating a new share of a file you own shows the file permissions
  24. Given user "user0" exists
  25. And user "user1" exists
  26. And As an "user0"
  27. And parameter "shareapi_default_permissions" of app "core" is set to "7"
  28. When creating a share with
  29. | path | welcome.txt |
  30. | shareWith | user1 |
  31. | shareType | 0 |
  32. And the OCS status code should be "100"
  33. And the HTTP status code should be "200"
  34. And Getting info of last share
  35. Then the OCS status code should be "100"
  36. And the HTTP status code should be "200"
  37. And Share fields of last share match with
  38. | item_permissions | 27 |
  39. Scenario: Receiving a share of a file gives no create permission
  40. Given user "user0" exists
  41. And user "user1" exists
  42. And As an "user0"
  43. And parameter "shareapi_default_permissions" of app "core" is set to "31"
  44. And file "welcome.txt" of user "user0" is shared with user "user1"
  45. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  46. And share 0 is returned with
  47. | path | /welcome.txt |
  48. | permissions | 19 |
  49. | item_permissions | 27 |
  50. When As an "user1"
  51. And user "user1" accepts last share
  52. And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  53. Then the list of returned shares has 1 shares
  54. And share 0 is returned with
  55. | path | /welcome (2).txt |
  56. | permissions | 19 |
  57. | item_permissions | 27 |
  58. Scenario: Receiving a share of a folder gives create permission
  59. Given user "user0" exists
  60. And user "user1" exists
  61. And As an "user0"
  62. And parameter "shareapi_default_permissions" of app "core" is set to "31"
  63. And file "PARENT/CHILD" of user "user0" is shared with user "user1"
  64. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  65. And share 0 is returned with
  66. | path | /PARENT/CHILD |
  67. | permissions | 31 |
  68. | item_permissions | 31 |
  69. When As an "user1"
  70. And user "user1" accepts last share
  71. And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  72. Then the list of returned shares has 1 shares
  73. And share 0 is returned with
  74. | path | /CHILD |
  75. | permissions | 31 |
  76. | item_permissions | 31 |
  77. # User can remove itself from a share
  78. Scenario: Receiving a share of a file without delete permission gives delete permission anyway
  79. Given user "user0" exists
  80. And user "user1" exists
  81. And As an "user0"
  82. And parameter "shareapi_default_permissions" of app "core" is set to "23"
  83. And file "welcome.txt" of user "user0" is shared with user "user1"
  84. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  85. And share 0 is returned with
  86. | path | /welcome.txt |
  87. | permissions | 19 |
  88. | item_permissions | 27 |
  89. When As an "user1"
  90. And user "user1" accepts last share
  91. And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  92. Then the list of returned shares has 1 shares
  93. And share 0 is returned with
  94. | path | /welcome (2).txt |
  95. | permissions | 19 |
  96. | item_permissions | 27 |
  97. Scenario: Receiving a share of a file without delete permission gives delete permission anyway
  98. Given user "user0" exists
  99. And user "user1" exists
  100. And As an "user0"
  101. And group "group1" exists
  102. And user "user1" belongs to group "group1"
  103. And parameter "shareapi_default_permissions" of app "core" is set to "23"
  104. And file "welcome.txt" of user "user0" is shared with group "group1"
  105. And sending "GET" to "/apps/files_sharing/api/v1/shares"
  106. And share 0 is returned with
  107. | path | /welcome.txt |
  108. | permissions | 19 |
  109. | item_permissions | 27 |
  110. When As an "user1"
  111. And user "user1" accepts last share
  112. And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  113. Then the list of returned shares has 1 shares
  114. And share 0 is returned with
  115. | path | /welcome (2).txt |
  116. | permissions | 19 |
  117. | item_permissions | 27 |