function _pwa_access_check in Progressive Web App 7.2
Custom access function to force the exclusion of the super admin for all serviceworker related things.
4 calls to _pwa_access_check()
- pwa_block_view in ./
pwa.module - Implements hook_block_view().
- pwa_preprocess_html in ./
pwa.module - Implements hook_preprocess_html().
- pwa_webpush_block_view in modules/
pwa_webpush/ pwa_webpush.module - Implements hook_block_view().
- _pwa_webpush_save_access in modules/
pwa_webpush/ pwa_webpush.module - Check the HTTP method as well as the permission.
1 string reference to '_pwa_access_check'
- pwa_menu in ./
pwa.module - Implements hook_menu().
File
- ./
pwa.module, line 211
Code
function _pwa_access_check($permission = '') {
// The user always need the 'access pwa' permission.
if (user_access('access pwa')) {
// Check an extra permission if necessary.
if (!empty($permission)) {
return user_access($permission);
}
return TRUE;
}
return FALSE;
}