Search

User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used by Ignition's Expression language.

Description
Returns true if the user has the given role. The username and usersource parameters are optional in the Client scope, but required in the Gateway scope.
Syntax

 hasRole(role[, username][, usersource])

  • Parameters

String role - The name of a role.

String username -  A username. Defaults to the current user. [optional]

String usersource - The usersource of the username. Defaults to the usersource of the current user. [optional]

  • Results

Boolean - True if the specified user has the specified role, False if not.

Examples
Code Snippet
// This is an example using a username and userSource:
hasRole("Administrator", "bob", "default")
Code Snippet
// This is an example using the current user and default userSource in the Client scope:
hasRole("Administrator")
  • No labels