Skip to main content
Version: V3 (Ignition 8.3)

tamaki.mes.permissions.isPermissionException

Description

Returns True if the given exception is a permission (access-denied) exception: that is, if its string representation contains MissingPermissionException. Returns False otherwise, including if the check itself fails.

Syntax

tamaki.mes.permissions.isPermissionException(exception)

Parameters

ParameterTypeNullableDescription
exceptionExceptionFalseThe caught exception (or any object whose string form is tested).

Returns

A Boolean: True if the exception is a permission exception, otherwise False.

Code Examples

try:
system.mes.location.deleteLocation(locationId)
except Exception as e:
if tamaki.mes.permissions.isPermissionException(e):
# The user does not have permission to delete this location
pass