Add Browse attachments ACL (RT#4964)
authormark <mark>
Tue, 29 Dec 2009 01:00:30 +0000 (01:00 +0000)
committermark <mark>
Tue, 29 Dec 2009 01:00:30 +0000 (01:00 +0000)
FS/FS/AccessRight.pm
httemplate/browse/cust_attachment.html
httemplate/elements/menu.html

index 8e771a9..ec0cce5 100644 (file)
@@ -220,7 +220,8 @@ tie my %rights, 'Tie::IxHash',
   'Customer note and attachment rights' => [
     'Add customer note', #NEW
     'Edit customer note', #NEW
-    'View attachments',
+    'View attachments', #NEW
+    'Browse attachments', #NEW
     'Download attachment', #NEW
     'Add attachment', #NEW
     'Edit attachment', #NEW
index d95f2b1..e19259d 100755 (executable)
@@ -62,7 +62,8 @@
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
-die "access denied" if !$curuser->access-right('View attachments');
+die "access denied" if !$curuser->access_right('View attachments')
+                    or !$curuser->access_right('Browse attachments');
 
 my $conf = new FS::Conf;
 
index ce0278f..167559d 100644 (file)
@@ -323,7 +323,7 @@ $tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
 $tools_menu{'Time Queue'} =  [ $fsurl.'search/report_timeworked.html', 'View pending support time' ]
   if $curuser->access_right('Time queue');
 $tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ]
-  if !$conf->config('disable_cust_attachment') and $curuser->access_right('View attachments');
+  if !$conf->config('disable_cust_attachment') and $curuser->access_right('View attachments') and $curuser->access_right('Browse attachments');
 $tools_menu{'Importing'} =  [ \%tools_importing, 'Import tools' ]
   if $curuser->access_right('Import');
 $tools_menu{'Exporting'} =  [ \%tools_exporting, 'Export tools' ]