Permalink
Browse files

Add support for scanning all servers permission

  • Loading branch information...
1 parent 72be098 commit 28c462ad1038e7ba5cef5529a104b720e8cf7428 @lattera lattera committed Jan 17, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 helpers.inc
View
6 helpers.inc
@@ -125,6 +125,9 @@ function add_servers_in_server_group($groupname, $servers=array()) {
/* User accesses */
function user_can_scan_group($user, $groupname) {
+ if (user_access('scan all servers', $user))
+ return TRUE;
+
foreach (user_role_permissions($user->roles) as $perms) {
foreach ($perms as $key => $value) {
if (strpos($key, $groupname) !== FALSE)
@@ -136,6 +139,9 @@ function user_can_scan_group($user, $groupname) {
}
function user_can_scan_server($user, $servername) {
+ if (user_access('scan all servers', $user))
+ return TRUE;
+
$groups = get_all_server_groups();
foreach ($groups as $group) {

0 comments on commit 28c462a

Please sign in to comment.