[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

raeburn raeburn@source.lon-capa.org
Wed, 15 Sep 2010 16:37:36 -0000


raeburn		Wed Sep 15 16:37:36 2010 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - Bug 4321.
    - Include vgr privilege checking for roles with sections.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.584 loncom/interface/lonprintout.pm:1.585
--- loncom/interface/lonprintout.pm:1.584	Wed Sep  1 23:58:40 2010
+++ loncom/interface/lonprintout.pm	Wed Sep 15 16:37:36 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.584 2010/09/01 23:58:40 raeburn Exp $
+# $Id: lonprintout.pm,v 1.585 2010/09/15 16:37:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3161,6 +3161,11 @@
 	$perm{'pfo'}=&Apache::lonnet::allowed('pfo',
 		  $env{'request.course.id'}.'/'.$env{'request.course.sec'});
     }
+    $perm{'vgr'}=&Apache::lonnet::allowed('vgr',$env{'request.course.id'});
+    if (!$perm{'vgr'}) {
+        $perm{'vgr'}=&Apache::lonnet::allowed('vgr',
+                   $env{'request.course.id'}.'/'.$env{'request.course.sec'});
+    }
 }
 
 sub get_randomly_ordered_warning {
@@ -3900,7 +3905,7 @@
     my $startedTable = 0; # have we started an HTML table yet? (need
                           # to close it later)
 
-    if (($perm{'pav'} and &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) or 
+    if (($perm{'pav'} and $perm{'vgr'}) or 
 	($helper->{VARS}->{'construction'} eq '1')) {
 	&addMessage('<br />'
                    .'<h3>'.&mt('Print Options').'</h3>'