unless_uid

Function unless_uid 

Source
pub fn unless_uid<'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 effective uid matches a set of given integer(s). It is the negated version of if_uid.

Usage:

  1. {{#unless_uid "1000,1001"}}..foo..{{/unless_uid}}

    Renders ..foo.. only if current user’s effective uid is neither 1000 nor 1001.

  2. {{#unless_uid 0}}..foo..{{else}}..bar..{{/unless_uid}}

    Renders ..foo.. only if current user’s effective uid is NOT 0, renders ..bar.. only if current user’s effective uid is 0.

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

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

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