its all about control
[freeside.git] / httemplate / browse / access_group.html
index 9ebb2b8..ca162a0 100644 (file)
@@ -1,4 +1,36 @@
-<%
+<% include( 'elements/browse.html',
+                 'title'       => 'Internal Access Groups',
+                 'menubar'     => [ # 'Main menu' => $p,
+                                    'Internal users' => $p.'browse/access_user.html',
+                                  ],
+                 'html_init'   => $html_init,
+                 'name'        => 'internal access groups',
+                 'query'       => { 'table'     => 'access_group',
+                                    'hashref'   => {},
+                                    'extra_sql' => 'ORDER BY groupname', #??
+                                  },
+                 'count_query' => $count_query,
+                 'header'      => [ '#',
+                                    'Group name',
+                                    'Agents',
+                                    'Rights',
+                                  ],
+                 'fields'      => [ 'groupnum',
+                                    'groupname',
+                                    $agents_sub,
+                                    $rights_sub,
+                                  ],
+                 'links'       => [ $link,
+                                    $link,
+                                    '',
+                                    '',
+                                  ],
+             )
+%>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
 my $html_init = 
   "Internal access groups control access to the back-office interface.<BR><BR>".
@@ -47,32 +79,4 @@ my $count_query = 'SELECT COUNT(*) FROM access_group';
 
 my $link = [ $p.'edit/access_group.html?', 'groupnum' ];
 
-%><%= include( 'elements/browse.html',
-                 'title'       => 'Internal Access Groups',
-                 'menubar'     => [ # 'Main menu' => $p,
-                                    'Internal users' => $p.'browse/access_user.html',
-                                  ],
-                 'html_init'   => $html_init,
-                 'name'        => 'internal access groups',
-                 'query'       => { 'table'     => 'access_group',
-                                    'hashref'   => {},
-                                    'extra_sql' => 'ORDER BY groupname', #??
-                                  },
-                 'count_query' => $count_query,
-                 'header'      => [ '#',
-                                    'Group name',
-                                    'Agents',
-                                    'Rights',
-                                  ],
-                 'fields'      => [ 'groupnum',
-                                    'groupname',
-                                    $agents_sub,
-                                    $rights_sub,
-                                  ],
-                 'links'       => [ $link,
-                                    $link,
-                                    '',
-                                    '',
-                                  ],
-             )
-%>
+</%init>