pub fn if_uid<'reg, 'rc>(
h: &Helper<'reg, 'rc>,
r: &'reg Handlebars<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>,
out: &mut dyn Output,
) -> HelperResultExpand description
A templating helper that tests if current user’s effective uid matches a set of given integer(s).
Usage:
-
{{#if_uid "1000,1001"}}..foo..{{/if_uid}}Renders
..foo..only if current user’s effective uid is either1000or1001. -
{{#if_uid 0}}..foo..{{else}}..bar..{{/if_uid}}Renders
..foo..only if current user’s effective uid is0, renders..bar..only if current user’s effective uid is not0. -
{{#if_uid some.array}}..foo..{{/if_uid}}Renders
..foo..only if current user’s effective uid is exactly one of the values from the templating variablesome.array(defined in the config file’s [[context]] section).
[[context]]: dt_core::config::ContextConfig