pub fn unless_user<'reg, 'rc>(
    h: &Helper<'reg, 'rc>,
    r: &'reg Handlebars<'reg>,
    ctx: &'rc Context,
    rc: &mut RenderContext<'reg, 'rc>,
    out: &mut dyn Output
) -> HelperResult
Expand description

A templating helper that tests if current user’s username does not match a set of given string(s). It is the negated version of if_user.

Usage:

  1. {{#unless_user "foo,bar"}}..baz..{{/unless_user}}

    Renders ..baz.. only if current user’s username is neither “foo” nor “bar”.

  2. {{#unless_user "foo"}}..baz..{{else}}..qux..{{/unless_user}}

    Renders ..baz.. only if current user’s username is NOT “foo”, renders ..qux.. only if current user’s username is “foo”.

  3. {{#unless_user some.array}}..foo..{{/unless_user}}

    Renders ..foo.. only if current user’s username is none of the values from the templating variable some.array (defined in the config file’s [[context]] section).

[[context]]: dt_core::config::ContextConfig