function tinybrowser_access in TinyBrowser 7
Check if the user has access or not
4 calls to tinybrowser_access()
- tinybrowser_init in ./
tinybrowser.module - Implements hook_init().
- tinybrowser_textarea in ./
tinybrowser.module - Inline image/link insertion to textareas.
- tinybrowser_user_page_access in ./
tinybrowser.userpage.inc - Check if the tinybrowser is available at user account page
- tinybrowser_wysiwyg_plugin in ./
tinybrowser.module - Implements hook_wysiwyg_plugin().
File
- ./
tinybrowser.module, line 1067
Code
function tinybrowser_access($user = FALSE) {
if ($user === FALSE) {
global $user;
}
if ($user->uid == 1) {
// admin
return TRUE;
}
$roles_profiles = variable_get('tinybrowser_roles_profiles', array());
foreach ($user->roles as $rid => $role) {
if (isset($roles_profiles[$rid]['pid']) && $roles_profiles[$rid]['pid']) {
return TRUE;
}
}
return FALSE;
}