Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/access-strategy-types/or.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: "collection-or(complex-allow-pipeline, noone)", | name: | ||||
"collection-or(nested-or(allow, noone), nested-and(allow, public))", | |||||
strategies: [ | strategies: [ | ||||
["or", ["complex-allow-pipeline", "noone"]], | ["or", ["complex-allow-pipeline", "noone"]], | ||||
["or", ["complex-allow-pipeline", "noone"]], | ["and", ["complex-allow-pipeline", "public"]], | ||||
], | ], | ||||
}, | }, | ||||
{ | { | ||||
name: "collection-or(complex-allow-pipeline, public)", | name: "collection-or(complex-allow-pipeline, public)", | ||||
strategies: ["complex-allow-pipeline", "public"], | strategies: ["complex-allow-pipeline", "public"], | ||||
}, | }, | ||||
{ | { | ||||
name: "collection-or(complex-deny-pipeline, noone)", | name: "collection-or(complex-deny-pipeline, noone)", | ||||
Show All 39 Lines | for (const number of numbers) { | ||||
["collections", name], | ["collections", name], | ||||
"create", | "create", | ||||
{ number: number.id } | { number: number.id } | ||||
) | ) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
it("returns everything for wrapped or(complex-allow-pipeline, noone)", () => | it("returns everything for collection-or(nested-or(allow, noone), nested-and(allow, public))", () => | ||||
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-or(complex-allow-pipeline, noone)", | collection: | ||||
"collection-or(nested-or(allow, noone), nested-and(allow, public))", | |||||
port, | port, | ||||
}).then(data => assert.equal(data.length, 3)); | }).then(data => assert.equal(data.length, 3)); | ||||
})); | })); | ||||
it("returns everything for or(complex-allow-pipeline, public)", () => | it("returns everything for or(complex-allow-pipeline, public)", () => | ||||
with_running_app(async ({ app }) => { | with_running_app(async ({ app }) => { | ||||
await setup(app); | await setup(app); | ||||
return get_collection_as({ | return get_collection_as({ | ||||
Show All 23 Lines |