--- loncom/interface/lonmenu.pm 2016/09/15 02:25:12 1.369.2.58
+++ loncom/interface/lonmenu.pm 2016/10/22 20:52:37 1.369.2.59
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.58 2016/09/15 02:25:12 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.59 2016/10/22 20:52:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -312,12 +312,12 @@ sub primary_menu {
undef,'tools')));
push(@primsub,$item);
}
- if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) {
- $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
- } else {
- $title = &mt($title);
- }
if (@primsub > 0) {
+ if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) {
+ $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+ } else {
+ $title = &mt($title);
+ }
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1);
} elsif ($link) {
$menu{$position} .= '
'.&mt($title).'';
@@ -390,7 +390,9 @@ sub secondary_menu {
}
my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec);
my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec);
+ my $canviewusers = &Apache::lonnet::allowed('vcl', $crs_sec);
my $canviewwnew = &Apache::lonnet::allowed('whn', $crs_sec);
+ my $canviewpara = &Apache::lonnet::allowed('vpa', $crs_sec);
my $canmodpara = &Apache::lonnet::allowed('opa', $crs_sec);
my $canvgr = &Apache::lonnet::allowed('vgr', $crs_sec);
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec);
@@ -454,17 +456,17 @@ sub secondary_menu {
next if $$menuitem[4] eq 'vgr'
&& !$canvgr;
next if $$menuitem[4] eq 'cst'
- && !$canmodifyuser;
+ && !$canmodifyuser && !$canviewusers;
next if $$menuitem[4] eq 'ncst'
- && ($canmodifyuser || !$canviewroster);
+ && ($canmodifyuser || !$canviewusers || !$canviewroster);
next if $$menuitem[4] eq 'mgr'
&& !$canmgr;
next if $$menuitem[4] eq 'showresv'
&& !$showresv;
next if $$menuitem[4] eq 'whn'
&& !$canviewwnew;
- next if $$menuitem[4] eq 'opa'
- && !$canmodpara;
+ next if $$menuitem[4] eq 'params'
+ && (!$canmodpara && !$canviewpara);
next if $$menuitem[4] eq 'nvcg'
&& ($canviewgrps || !%groups);
next if $$menuitem[4] eq 'showsyllabus'
@@ -491,6 +493,7 @@ sub secondary_menu {
if (ref($item) eq 'ARRAY') {
next if ($item->[2] eq 'vgr' && !$canvgr);
next if ($item->[2] eq 'opa' && !$canmodpara);
+ next if ($item->[2] eq 'vpa' && !$canviewpara);
next if ($item->[2] eq 'cst' && !$canmodifyuser);
next if ($item->[2] eq 'mgr' && !$canmgr);
next if ($item->[2] eq 'vcg' && !$canviewgrps);
@@ -825,7 +828,7 @@ sub innerregister {
if ($env{'request.filename'}=~/$LONCAPA::assess_re/) {
push(@privs,('mgr','vgr'));
}
- push(@privs,'opa');
+ push(@privs,('opa','vpa'));
}
foreach my $priv (@privs) {
$perms{$priv} = &Apache::lonnet::allowed($priv,$env{'request.course.id'});
@@ -851,7 +854,7 @@ sub innerregister {
'Content Submissions');
}
}
- if (($env{'request.symb'} ne '') && ($perms{'opa'})) {
+ if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) {
$hwkadd .= &switch('','',7,3,'pparm.png','Content Settings',
'parms[_2]',"gocmd('/adm/parmset','set')",
'Content Settings');