diff --git a/browscap.module b/browscap.module index 5e4d330..df00cc4 100644 --- a/browscap.module +++ b/browscap.module @@ -14,6 +14,7 @@ function browscap_perm() { return array( 'administer browscap', 'view browscap reports', + 'bypass browscap monitoring', ); } @@ -93,8 +94,9 @@ function browscap_help($path, $arg) { * Implementation of hook_exit(). */ function browscap_exit() { - // Record the current user agent if monitoring is enabled - if (variable_get('browscap_enable_user_agent_log', FALSE) == TRUE) { + // Record the current user agent if monitoring is enabled and the user does not + // have permission to bypass monitoring + if (variable_get('browscap_enable_user_agent_log', FALSE) == TRUE && user_access('bypass browscap monitoring') != TRUE) { // Get browscap data about the current user agent $user_agent = browscap_get_browser();