Skip to main content

with_codename_gate

Function with_codename_gate 

Source
pub fn with_codename_gate(
    router: Router,
    codename: &'static str,
    no_access_url: impl Into<String>,
) -> Router
Expand description

Hard-gate router on an arbitrary permission codename — the generalized form of with_cms_admin_access. A non-superuser lacking codename is redirected to no_access_url; superusers pass; anonymous flows fall through to the layered login_required bounce. Static assets + the no-access page itself always pass so the redirect can’t loop and the page can style itself.