suspend fun checkPermission(node: Node, permission: Permission, errorMessage: String)

Checks if the permission is granted on node If checkPermission on the permission.context is false, no permission is evaluated Does not handle the case that the user is an admin

Parameters

node

the node where the permission must be granted

permission

the permission to check for, none is checked if null

errorMessage

the message to throw in case the permission is not granted, appended to "User does not have permission to"

Throws

with the provided errorMessage in case the permission is not granted