Brimbox Logo Brimbox Version 2.3.4 Released


Method to check whether user has sufficient permission for a module, dies and kills current session on insufficient permission.

Class: bb_main, called as $main

File: bb_main.php (php)


function check_permission($interface, $usertypes)


$main->check_permission($interface, $usertypes);

Action: A session_destroy() call if current permission is not verified.

Parameter: $interface (string)
The expected interface for the module.

Parameter: $usertypes(integer or array of integer)
The usertype(s), or integer part of the userrole or userroles expected for the current module.

This function also uses constants ADMIN_ONLY and SINGLE_USER_ONLY defined in bb_config.php, ADMIN_ONLY will check that the all users are admins for the standard interface. SINGLE_USER_ONLY will limit the program to one user based on email in any interface or interfaces.

Updated: 2016-06-16