|
| 1 | +@ocm |
| 2 | +Feature: List a federated sharing permissions |
| 3 | + As a user |
| 4 | + I want to list the permissions for federated share |
| 5 | + So that the federated share is assigned the correct permissions |
| 6 | + |
| 7 | + Background: |
| 8 | + Given user "Alice" has been created with default attributes |
| 9 | + |
| 10 | + @issue-9898 |
| 11 | + Scenario: user lists permissions of a resource shared to a federated user |
| 12 | + Given using server "LOCAL" |
| 13 | + And "Alice" has created the federation share invitation |
| 14 | + And using server "REMOTE" |
| 15 | + And user "Brian" has been created with default attributes |
| 16 | + And "Brian" has accepted invitation |
| 17 | + And using server "LOCAL" |
| 18 | + And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt" |
| 19 | + And user "Alice" has sent the following resource share invitation to federated user: |
| 20 | + | resource | textfile.txt | |
| 21 | + | space | Personal | |
| 22 | + | sharee | Brian | |
| 23 | + | shareType | user | |
| 24 | + | permissionsRole | Viewer | |
| 25 | + When user "Alice" gets permissions list for file "textfile.txt" of the space "Personal" using the Graph API |
| 26 | + Then the HTTP status code should be "200" |
| 27 | + And the JSON data of the response should match |
| 28 | + """ |
| 29 | + { |
| 30 | + "type": "object", |
| 31 | + "required": [ |
| 32 | + "@libre.graph.permissions.actions.allowedValues", |
| 33 | + "@libre.graph.permissions.roles.allowedValues", |
| 34 | + "value" |
| 35 | + ], |
| 36 | + "properties": { |
| 37 | + "value": { |
| 38 | + "type": "array", |
| 39 | + "minItems": 1, |
| 40 | + "maxItems": 1, |
| 41 | + "uniqueItems": true, |
| 42 | + "items": { |
| 43 | + "oneOf":[ |
| 44 | + { |
| 45 | + "type": "object", |
| 46 | + "required": [ |
| 47 | + "grantedToV2", |
| 48 | + "id", |
| 49 | + "roles" |
| 50 | + ], |
| 51 | + "properties": { |
| 52 | + "grantedToV2": { |
| 53 | + "type": "object", |
| 54 | + "required": ["user"], |
| 55 | + "properties": { |
| 56 | + "user": { |
| 57 | + "type": "object", |
| 58 | + "required": ["@libre.graph.userType","displayName","id"], |
| 59 | + "properties": { |
| 60 | + "@libre.graph.userType": { |
| 61 | + "const": "Federated" |
| 62 | + }, |
| 63 | + "id": { |
| 64 | + "type": "string", |
| 65 | + "pattern": "^%federated_user_id_pattern%$" |
| 66 | + }, |
| 67 | + "displayName": { |
| 68 | + "const": "Brian Murphy" |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | + }, |
| 74 | + "id": { |
| 75 | + "type": "string", |
| 76 | + "pattern": "^%user_id_pattern%$" |
| 77 | + }, |
| 78 | + "invitation": { |
| 79 | + "type": "object", |
| 80 | + "required": ["invitedBy"], |
| 81 | + "properties": { |
| 82 | + "invitedBy": { |
| 83 | + "type": "object", |
| 84 | + "required": ["user"], |
| 85 | + "properties": { |
| 86 | + "user": { |
| 87 | + "type": "object", |
| 88 | + "required": ["@libre.graph.userType", "displayName", "id"], |
| 89 | + "properties": { |
| 90 | + "@libre.graph.userType": { |
| 91 | + "const": "Member" |
| 92 | + }, |
| 93 | + "id": { |
| 94 | + "type": "string", |
| 95 | + "pattern": "^%user_id_pattern%$" |
| 96 | + }, |
| 97 | + "displayName": { |
| 98 | + "const": "Alice Hansen" |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + }, |
| 106 | + "roles": { |
| 107 | + "type": "array", |
| 108 | + "minItems": 1, |
| 109 | + "maxItems": 1, |
| 110 | + "items": { |
| 111 | + "type": "string", |
| 112 | + "pattern": "^%role_id_pattern%$" |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + } |
| 117 | + ] |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + } |
| 122 | + """ |
| 123 | + |
| 124 | + @issue-9745 @env-config |
| 125 | + Scenario: user lists allowed file permissions for federated user |
| 126 | + Given using server "LOCAL" |
| 127 | + And the administrator has enabled the permissions role "Secure Viewer" |
| 128 | + And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt" |
| 129 | + When user "Alice" gets the allowed roles for federated user of file "textfile.txt" from the space "Personal" using the Graph API |
| 130 | + Then the HTTP status code should be "200" |
| 131 | + And the JSON data of the response should match |
| 132 | + """ |
| 133 | + { |
| 134 | + "type": "object", |
| 135 | + "required": [ |
| 136 | + "@libre.graph.permissions.roles.allowedValues" |
| 137 | + ], |
| 138 | + "properties": { |
| 139 | + "@libre.graph.permissions.roles.allowedValues": { |
| 140 | + "type": "array", |
| 141 | + "minItems": 2, |
| 142 | + "maxItems": 2, |
| 143 | + "uniqueItems": true, |
| 144 | + "items": { |
| 145 | + "oneOf":[ |
| 146 | + { |
| 147 | + "type": "object", |
| 148 | + "required": [ |
| 149 | + "@libre.graph.weight", |
| 150 | + "description", |
| 151 | + "displayName", |
| 152 | + "id" |
| 153 | + ], |
| 154 | + "properties": { |
| 155 | + "@libre.graph.weight": { |
| 156 | + "const": 1 |
| 157 | + }, |
| 158 | + "description": { |
| 159 | + "const": "View and download." |
| 160 | + }, |
| 161 | + "displayName": { |
| 162 | + "const": "Can view" |
| 163 | + }, |
| 164 | + "id": { |
| 165 | + "const": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" |
| 166 | + } |
| 167 | + } |
| 168 | + }, |
| 169 | + { |
| 170 | + "type": "object", |
| 171 | + "required": [ |
| 172 | + "@libre.graph.weight", |
| 173 | + "description", |
| 174 | + "displayName", |
| 175 | + "id" |
| 176 | + ], |
| 177 | + "properties": { |
| 178 | + "@libre.graph.weight": { |
| 179 | + "const": 2 |
| 180 | + }, |
| 181 | + "description": { |
| 182 | + "const": "View, download and edit." |
| 183 | + }, |
| 184 | + "displayName": { |
| 185 | + "const": "Can edit" |
| 186 | + }, |
| 187 | + "id": { |
| 188 | + "const": "2d00ce52-1fc2-4dbc-8b95-a73b73395f5a" |
| 189 | + } |
| 190 | + } |
| 191 | + } |
| 192 | + ] |
| 193 | + } |
| 194 | + } |
| 195 | + } |
| 196 | + } |
| 197 | + """ |
| 198 | + |
| 199 | + @issue-9745 |
| 200 | + Scenario: user lists allowed folder permissions for federated user |
| 201 | + Given using server "LOCAL" |
| 202 | + And the administrator has enabled the permissions role "Secure Viewer" |
| 203 | + And user "Alice" has created folder "folderToShare" |
| 204 | + When user "Alice" gets the allowed roles for federated user of folder "folderToShare" from the space "Personal" using the Graph API |
| 205 | + Then the HTTP status code should be "200" |
| 206 | + And the JSON data of the response should match |
| 207 | + """ |
| 208 | + { |
| 209 | + "type": "object", |
| 210 | + "required": [ |
| 211 | + "@libre.graph.permissions.roles.allowedValues" |
| 212 | + ], |
| 213 | + "properties": { |
| 214 | + "@libre.graph.permissions.roles.allowedValues": { |
| 215 | + "type": "array", |
| 216 | + "minItems": 2, |
| 217 | + "maxItems": 2, |
| 218 | + "uniqueItems": true, |
| 219 | + "items": { |
| 220 | + "oneOf":[ |
| 221 | + { |
| 222 | + "type": "object", |
| 223 | + "required": [ |
| 224 | + "@libre.graph.weight", |
| 225 | + "description", |
| 226 | + "displayName", |
| 227 | + "id" |
| 228 | + ], |
| 229 | + "properties": { |
| 230 | + "@libre.graph.weight": { |
| 231 | + "const": 1 |
| 232 | + }, |
| 233 | + "description": { |
| 234 | + "const": "View and download." |
| 235 | + }, |
| 236 | + "displayName": { |
| 237 | + "const": "Can view" |
| 238 | + }, |
| 239 | + "id": { |
| 240 | + "const": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" |
| 241 | + } |
| 242 | + } |
| 243 | + }, |
| 244 | + { |
| 245 | + "type": "object", |
| 246 | + "required": [ |
| 247 | + "@libre.graph.weight", |
| 248 | + "description", |
| 249 | + "displayName", |
| 250 | + "id" |
| 251 | + ], |
| 252 | + "properties": { |
| 253 | + "@libre.graph.weight": { |
| 254 | + "const": 2 |
| 255 | + }, |
| 256 | + "description": { |
| 257 | + "const": "View, download, upload, edit, add and delete." |
| 258 | + }, |
| 259 | + "displayName": { |
| 260 | + "const": "Can edit" |
| 261 | + }, |
| 262 | + "id": { |
| 263 | + "const": "fb6c3e19-e378-47e5-b277-9732f9de6e21" |
| 264 | + } |
| 265 | + } |
| 266 | + } |
| 267 | + ] |
| 268 | + } |
| 269 | + } |
| 270 | + } |
| 271 | + } |
| 272 | + """ |
0 commit comments