isAllowedTo

Description

Slightly stronger version of allowedTo with error handling.

Syntax

void isAllowedTo (mixed $permissions[, mixed $boards])



Parameter $permissions

Expected type: Mixed
Description: A single permission or an array of permissions

Allowed types for $permissions
Allowed values Description
String A single permission
Array An array of permissions



Parameter $boards

Expected type: Mixed
Description: If specified, permissions will be checked for the specified board(s) instead of the current one

Allowed types for $boards
Allowed values Description
Integer The ID of a specific board
Array An array of integers corresponding to the IDs of the boards to check permissions on


Notes

  • If the user doesn't have the permission, and they're a guest, is_not_guest is called to allow them to login first (since they might be able to do it if they're logged in).
  • If they are logged in and can't do it, dies with a fatal_lang_error using the appropriate "cannot_permissionname" message
  • If there are any "heavy" permissions involved, and the user doesn't have any of the regular permissions but does have at least one "heavy" permission, validateSession() is called to validate their session
Advertisement: