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

raeburn raeburn at source.lon-capa.org
Fri Dec 28 12:08:45 EST 2012


raeburn		Fri Dec 28 17:08:45 2012 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
   "People" item in secondary menu if user's current role is author.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.403 loncom/interface/lonmenu.pm:1.404
--- loncom/interface/lonmenu.pm:1.403	Thu Dec 27 05:34:07 2012
+++ loncom/interface/lonmenu.pm	Fri Dec 28 17:08:44 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.403 2012/12/27 05:34:07 raeburn Exp $
+# $Id: lonmenu.pm,v 1.404 2012/12/28 17:08:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -326,6 +326,15 @@
     my $canmgr        = &Apache::lonnet::allowed('mgr', $crs_sec); 
     my $author        = &getauthor();
 
+    my ($canmodifycoauthor); 
+    if ($env{'request.role'} eq "au./$env{'user.domain'}/") {
+        my $extent = "$env{'user.domain'}/$env{'user.name'}";
+        if ((&Apache::lonnet::allowed('cca',$extent)) ||
+            (&Apache::lonnet::allowed('caa',$extent))) {
+            $canmodifycoauthor = 1;
+        }
+    }
+
     my %groups = &Apache::lonnet::get_active_groups(
                      $env{'user.domain'}, $env{'user.name'},
                      $env{'course.' . $env{'request.course.id'} . '.domain'},
@@ -337,7 +346,7 @@
         # evaluate conditions 
         next if    ref($menuitem)  ne 'ARRAY';
         next if    $$menuitem[4]   ne 'always'
-                && $$menuitem[4]   ne 'author'
+                && ($$menuitem[4]   ne 'author' && $$menuitem[4] ne 'cca')
                 && !$env{'request.course.id'};
         next if    $$menuitem[4]   =~ /^mdc/
                 && !$canedit;
@@ -362,6 +371,8 @@
                 && !%groups;
         next if    $$menuitem[4]    eq 'author'
                 && !$author;
+        next if    $$menuitem[4]    eq 'cca'
+                && !$canmodifycoauthor;
 
         if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) {
             # special treatment for role selector




More information about the LON-CAPA-cvs mailing list