summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
authorivan <ivan>2010-05-20 22:48:42 +0000
committerivan <ivan>2010-05-20 22:48:42 +0000
commitf1cd7f98b487e74aa60b6c41d3377cc60f7ac25a (patch)
tree9cb67dd062685eaad04db1cb78ac00516c866718 /httemplate/browse
parent85c3933c8b7508ab2aeb0f9e6b96dd1b6432fb9f (diff)
agent virt inventory, RT#7010
Diffstat (limited to 'httemplate/browse')
-rw-r--r--httemplate/browse/inventory_class.html20
1 files changed, 15 insertions, 5 deletions
diff --git a/httemplate/browse/inventory_class.html b/httemplate/browse/inventory_class.html
index 8ce131ac2..4ad72a2ea 100644
--- a/httemplate/browse/inventory_class.html
+++ b/httemplate/browse/inventory_class.html
@@ -1,9 +1,7 @@
<% include( 'elements/browse.html',
'title' => 'Inventory Classes',
'name' => 'inventory classes',
- 'menubar' => [ 'Add a new inventory class' =>
- $p.'edit/inventory_class.html',
- ],
+ 'menubar' => $menubar,
'query' => { 'table' => 'inventory_class', },
'count_query' => 'SELECT COUNT(*) FROM inventory_class',
'header' => [ '#', 'Inventory class', 'Inventory' ],
@@ -66,8 +64,12 @@
%>
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $curuser->access_right('Edit inventory')
+ || $curuser->access_right('Edit global inventory')
+ || $curuser->access_right('Configuration');
tie my %labels, 'Tie::IxHash',
'num_avail' => 'Available', # <FONT SIZE="-1"><A HREF="eventually">(upload batch)</A></FONT>',
@@ -88,6 +90,14 @@ my %inv_action_link = (
],
);
-my $link = [ "${p}edit/inventory_class.html?", 'classnum' ];
+my $menubar = $curuser->access_right('Configuration')
+ ? [ 'Add a new inventory class' =>
+ $p.'edit/inventory_class.html',
+ ]
+ : [];
+
+my $link = $curuser->access_right('Configuration')
+ ? [ "${p}edit/inventory_class.html?", 'classnum' ]
+ : '';
</%init>