--- loncom/interface/lonmenu.pm 2016/05/04 05:54:51 1.447
+++ loncom/interface/lonmenu.pm 2016/10/16 21:49:51 1.455
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.447 2016/05/04 05:54:51 raeburn Exp $
+# $Id: lonmenu.pm,v 1.455 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -386,8 +386,10 @@ sub secondary_menu {
undef($canviewroster);
}
my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec);
- my $canmodifyuser = &Apache::lonnet::allowed('cst', $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);
@@ -457,17 +459,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] =~ /showgroups$/
&& !$canviewgrps
&& !$grouptools;
@@ -749,7 +751,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'});
@@ -773,7 +775,7 @@ sub innerregister {
'Content Submissions');
}
}
- if (($env{'request.symb'} ne '') && ($perms{'opa'})) {
+ if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) {
&switch('','',7,3,'pparm.png','Content Settings','parms[_2]',
"gocmd('/adm/parmset','set')",
'Content Settings');
@@ -812,7 +814,11 @@ sub innerregister {
if ($currdir =~ m-/$-) {
$is_const_dir = 1;
if ($thisdisfn eq '') {
- $is_const_dir = 2;
+ unless (($env{'request.course.id'}) &&
+ ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) &&
+ ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) {
+ $is_const_dir = 2;
+ }
}
} else {
$currdir =~ s|[^/]+$||;
@@ -873,12 +879,15 @@ ENDMENUITEMS
$got_prt = 1;
if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/)
&& (!$env{'request.enc'})) {
- # wishlist is only available for users with access to resource-pool
- # and links can only be set for resources within the resource-pool
- $menuitems .= (<
$lt{'preamble'} $lt{$type}
$lt{'miss'}$lt{'proctor'}
- @@ -1796,7 +1797,7 @@ END