Skip to content

Commit 930f905

Browse files
authored
Merge pull request #10722 from owncloud/list-permission-denied
[tests-only][full-ci] adding test for listing permission of a folder in personal and project space with denied role enabled
2 parents b725c17 + 89baa04 commit 930f905

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-0
lines changed

tests/acceptance/TestHelpers/GraphHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class GraphHelper {
4343
public const ADDITIONAL_PERMISSIONS_ROLES = [
4444
'Secure Viewer' => 'aa97fe03-7980-45ac-9e50-b325749fd7e6',
4545
'Space Editor Without Versions' => '3284f2d5-0070-4ad8-ac40-c247f7c1fb27',
46+
'Denied' => '63e64e19-8d43-42ec-a738-2b6af2610efa',
4647
];
4748

4849
public const SHARES_SPACE_ID = 'a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668';

tests/acceptance/features/apiSharingNg1/listPermissions.feature

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,3 +2392,194 @@ Feature: List a sharing permissions
23922392
}
23932393
}
23942394
"""
2395+
2396+
@env-config
2397+
Scenario: user lists permissions of a folder after enabling 'Denied' role
2398+
Given the administrator has enabled the permissions role "Denied"
2399+
And user "Alice" has created folder "folder"
2400+
When user "Alice" gets permissions list for folder "folder" of the space "Personal" using the Graph API
2401+
Then the HTTP status code should be "200"
2402+
And the JSON data of the response should match
2403+
"""
2404+
{
2405+
"type": "object",
2406+
"required": [
2407+
"@libre.graph.permissions.actions.allowedValues",
2408+
"@libre.graph.permissions.roles.allowedValues"
2409+
],
2410+
"properties": {
2411+
"@libre.graph.permissions.roles.allowedValues": {
2412+
"type": "array",
2413+
"minItems": 4,
2414+
"maxItems": 4,
2415+
"uniqueItems": true,
2416+
"items": {
2417+
"oneOf": [
2418+
{
2419+
"type": "object",
2420+
"required": [
2421+
"@libre.graph.weight",
2422+
"description",
2423+
"displayName",
2424+
"id"
2425+
],
2426+
"properties": {
2427+
"@libre.graph.weight": {
2428+
"const": 1
2429+
},
2430+
"description": {
2431+
"const": "Deny all access."
2432+
},
2433+
"displayName": {
2434+
"const": "Cannot access"
2435+
},
2436+
"id": {
2437+
"const": "63e64e19-8d43-42ec-a738-2b6af2610efa"
2438+
}
2439+
}
2440+
},
2441+
{
2442+
"type": "object",
2443+
"required": [
2444+
"@libre.graph.weight",
2445+
"description",
2446+
"displayName",
2447+
"id"
2448+
],
2449+
"properties": {
2450+
"displayName": {
2451+
"const": "Can view"
2452+
}
2453+
}
2454+
},
2455+
{
2456+
"type": "object",
2457+
"required": [
2458+
"@libre.graph.weight",
2459+
"description",
2460+
"displayName",
2461+
"id"
2462+
],
2463+
"properties": {
2464+
"displayName": {
2465+
"const": "Can upload"
2466+
}
2467+
}
2468+
},
2469+
{
2470+
"type": "object",
2471+
"required": [
2472+
"@libre.graph.weight",
2473+
"description",
2474+
"displayName",
2475+
"id"
2476+
],
2477+
"properties": {
2478+
"displayName": {
2479+
"const": "Can edit"
2480+
}
2481+
}
2482+
}
2483+
]
2484+
}
2485+
}
2486+
}
2487+
}
2488+
"""
2489+
2490+
@env-config
2491+
Scenario: user lists permissions of a folder inside a space after enabling 'Denied' role
2492+
Given using spaces DAV path
2493+
And the administrator has enabled the permissions role "Denied"
2494+
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
2495+
And user "Alice" has created a space "new-space" with the default quota using the Graph API
2496+
And user "Alice" has created a folder "folder" in space "new-space"
2497+
When user "Alice" gets permissions list for folder "folder" of the space "new-space" using the Graph API
2498+
Then the HTTP status code should be "200"
2499+
And the JSON data of the response should match
2500+
"""
2501+
{
2502+
"type": "object",
2503+
"required": [
2504+
"@libre.graph.permissions.actions.allowedValues",
2505+
"@libre.graph.permissions.roles.allowedValues"
2506+
],
2507+
"properties": {
2508+
"@libre.graph.permissions.roles.allowedValues": {
2509+
"type": "array",
2510+
"minItems": 4,
2511+
"maxItems": 4,
2512+
"uniqueItems": true,
2513+
"items": {
2514+
"oneOf": [
2515+
{
2516+
"type": "object",
2517+
"required": [
2518+
"@libre.graph.weight",
2519+
"description",
2520+
"displayName",
2521+
"id"
2522+
],
2523+
"properties": {
2524+
"@libre.graph.weight": {
2525+
"const": 1
2526+
},
2527+
"description": {
2528+
"const": "Deny all access."
2529+
},
2530+
"displayName": {
2531+
"const": "Cannot access"
2532+
},
2533+
"id": {
2534+
"const": "63e64e19-8d43-42ec-a738-2b6af2610efa"
2535+
}
2536+
}
2537+
},
2538+
{
2539+
"type": "object",
2540+
"required": [
2541+
"@libre.graph.weight",
2542+
"description",
2543+
"displayName",
2544+
"id"
2545+
],
2546+
"properties": {
2547+
"displayName": {
2548+
"const": "Can view"
2549+
}
2550+
}
2551+
},
2552+
{
2553+
"type": "object",
2554+
"required": [
2555+
"@libre.graph.weight",
2556+
"description",
2557+
"displayName",
2558+
"id"
2559+
],
2560+
"properties": {
2561+
"displayName": {
2562+
"const": "Can upload"
2563+
}
2564+
}
2565+
},
2566+
{
2567+
"type": "object",
2568+
"required": [
2569+
"@libre.graph.weight",
2570+
"description",
2571+
"displayName",
2572+
"id"
2573+
],
2574+
"properties": {
2575+
"displayName": {
2576+
"const": "Can edit"
2577+
}
2578+
}
2579+
}
2580+
]
2581+
}
2582+
}
2583+
}
2584+
}
2585+
"""

0 commit comments

Comments
 (0)