--- loncom/interface/lonmenu.pm 2012/12/27 05:34:07 1.403 +++ loncom/interface/lonmenu.pm 2012/12/28 17:08:44 1.404 @@ -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 @@ sub secondary_menu { 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 @@ sub secondary_menu { # 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 @@ sub secondary_menu { && !%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