User & Organization
Check a permission
Tells whether the current user holds a permission, so you can hide or disable controls they can't use.
bridge.isPermissionAllowed(permission) // → Promise<boolean>Parameters
permission
string
yes
One of the names below. Case-sensitive
VIEW_EVENTS
Bound device
✅
✅
Events, openDeviceEvents
EDIT_EVENTS
Bound device
✅
✅
Comment, resolve, archive, notes
QUERY_DATA_ENGINE
Organization
✅
✅
executeDataEngineQuery
VIEW_DEVICE_INFO
Bound device
✅
✅
openDeviceInfo
VIEW_AUTOMATIONS
Organization
✅
✅
openAutomations
VIEW_DEVICE_TAGS
Bound device
✅
✅
getDeviceTags
VIEW_DEVICE_FILES
Bound device
✅
✅
Device file lists and content
EDIT_DEVICE_FILES
Bound device
✅
✅
uploadDeviceFile, deleteDeviceFile
VIEW_ASSETS
Organization
✅
✅
Assets
CONTROL_DEVICE
Bound device
❌
✅
Writing datastream values
EDIT_DEVICE_METADATA
Bound device
❌
✅
updateDeviceMetadata
Resolves with true or false.
Rejects with invalid_request for a name the host doesn't accept — on web that includes CONTROL_DEVICE and EDIT_DEVICE_METADATA — request_timeout (web, 10 seconds), and device_unavailable when the host has no permission bridge. Never let a failed check hard-block your UI:
const may = (permission, fallback = true) =>
bridge.isPermissionAllowed(permission).catch(() => fallback);
const canControl = await may('CONTROL_DEVICE'); // true on web, the real answer on mobileA permission check is a UI hint. The server stays authoritative for every read and write.
Get unit systems
Returns the unit systems chosen by the organization and the user.
Parameters: none.
Resolves with
orgUnitSystem
string | null
'METRIC' or 'IMPERIAL'; null when the organization never set one
userUnitSystem
string | null
'METRIC' or 'IMPERIAL'; null when the user follows the organization default
Rejects with request_timeout (web, 10 seconds), device_unavailable, bridge_destroyed.
Individual datastreams also carry their own unitSystem field.
Was this helpful?

