The OpenD Programming Language

passFilterOrIssueError

For use with dispatchSubsection. Calls your filter with the request and if your filter returns false, this issues the given errorCode and stops processing.

bool hasAdminPermissions(Cgi cgi) {
	return true;
}

mixin DispatcherMain!(
	"/admin".dispatchSubsection!(
		passFilterOrIssueError!(hasAdminPermissions, 403),
		KeepExistingPresenter,
		"/".serveApi!AdminFunctions
	)
);
template passFilterOrIssueError(alias filter, int errorCode)
version(with_breaking_cgi_features)
bool
passFilterOrIssueError
(
DispatcherDetails
)
(
DispatcherDetails dd
)

Meta

History

Added January 28, 2023 (dub v11.0)