Page MenuHomeSealhub

Sealious: Support for simpler "If" policy construction
Closed, ResolvedPublic2 Points

Description

Currently the If access policy relies on special filters:

policies = {
	edit: new Policies.If(
		"comments",
		"submitted",
		new Policies.Public(),
		new Roles(["admin"])
	),
};

named_filters = {
	submitted: new SpecialFilters.Matches("stories", { submitted: true }),
};

This task is about making it so the If policy can optionally take a regular filter value instead of just the named filter name:

policies = {
	edit: new Policies.If(
		"comments",
		{ submitted: true }, // <-------------
		new Policies.Public(),
		new Roles(["admin"])
	),
};

This needs to be tested thoroughly

Details

Tested by
kuba-orlik
Coded by
ziomek
Reviewed by
kuba-orlik
Action required from
ziomek

Revisions and Commits

Event Timeline

kuba-orlik changed the point value for this task from 1 to 2.
ziomek updated Coded by, added: ziomek.
ziomek moved this task from To do to Doing on the Kanban board.
ziomek added a revision: Restricted Differential Revision.Dec 4 2025, 17:58
jenkins-user moved this task from Doing to Review on the Kanban board.
jenkins-user updated Action required from, added: FilipI; removed: ziomek.
jenkins-user added a subscriber: ziomek.
jenkins-user moved this task from Review to Doing on the Kanban board.
jenkins-user updated Reviewed by, added: kuba-orlik.
jenkins-user updated Action required from, added: ziomek; removed: FilipI.
jenkins-user moved this task from Doing to Review on the Kanban board.
jenkins-user updated Action required from, added: kuba-orlik; removed: ziomek.
jenkins-user assigned this task to ziomek.
jenkins-user moved this task from Review to Ready for testing on the Kanban board.
jenkins-user updated Action required from, added: AmeliaB, • Koossa, karolwojtowicz87, brtkuu, prostyfranek, zbartosz, radoptak; removed: kuba-orlik.
jenkins-user updated Tested by, added: kuba-orlik.
jenkins-user moved this task from Ready for testing to Ready to land on the Kanban board.
jenkins-user updated Action required from, added: ziomek; removed: AmeliaB, • Koossa, karolwojtowicz87, brtkuu, prostyfranek, zbartosz, radoptak.