Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/access-strategy-types/and.subtest.js
Show All 20 Lines | app.createChip(Sealious.Collection, { | ||||
}, | }, | ||||
], | ], | ||||
}); | }); | ||||
create_strategies.allow_deny(app); | create_strategies.allow_deny(app); | ||||
const collections = [ | const collections = [ | ||||
{ | { | ||||
name: | |||||
kuba-orlik: (should) przydałoby się dla czytelności opisać także te wewnętrzne funkcje:
```
collection-and… | |||||
"collection-and(nested-and(allow, public), nested-or(allow, noone))", | |||||
strategies: [ | |||||
["and", ["complex-allow-pipeline", "public"]], | |||||
["or", ["complex-allow-pipeline", "noone"]], | |||||
], | |||||
}, | |||||
{ | |||||
name: "collection-and(complex-allow-pipeline, noone)", | name: "collection-and(complex-allow-pipeline, noone)", | ||||
strategies: ["complex-allow-pipeline", "noone"], | strategies: ["complex-allow-pipeline", "noone"], | ||||
}, | }, | ||||
{ | { | ||||
name: "collection-and(complex-allow-pipeline, public)", | name: "collection-and(complex-allow-pipeline, public)", | ||||
strategies: ["complex-allow-pipeline", "public"], | strategies: ["complex-allow-pipeline", "public"], | ||||
}, | }, | ||||
{ | { | ||||
Show All 36 Lines | for (const number of numbers) { | ||||
["collections", name], | ["collections", name], | ||||
"create", | "create", | ||||
{ number: number.id } | { number: number.id } | ||||
) | ) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
it("return everything for collection-and(nested-and(allow, public), nested-or(allow, noone))", () => | |||||
with_running_app(async ({ app }) => { | |||||
await setup(app); | |||||
return get_collection_as({ | |||||
collection: | |||||
"collection-and(nested-and(allow, public), nested-or(allow, noone))", | |||||
port, | |||||
}).then(data => assert.equal(data.length, 3)); | |||||
})); | |||||
it("returns nothing for and(complex-allow-pipeline, noone)", () => | it("returns nothing for and(complex-allow-pipeline, noone)", () => | ||||
with_running_app(async ({ app }) => { | with_running_app(async ({ app }) => { | ||||
await setup(app); | await setup(app); | ||||
return get_collection_as({ | return get_collection_as({ | ||||
collection: "collection-and(complex-allow-pipeline, noone)", | collection: "collection-and(complex-allow-pipeline, noone)", | ||||
port, | port, | ||||
}).then(data => assert.equal(data.length, 0)); | }).then(data => assert.equal(data.length, 0)); | ||||
})); | })); | ||||
Show All 19 Lines |
(should) przydałoby się dla czytelności opisać także te wewnętrzne funkcje: