[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
raeburn
raeburn at source.lon-capa.org
Wed Apr 5 14:09:52 EDT 2023
raeburn Wed Apr 5 18:09:52 2023 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- Bug 2832
Display Edit button in Functions menu for published resource in a course,
where role is instructor.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1506 loncom/lonnet/perl/lonnet.pm:1.1507
--- loncom/lonnet/perl/lonnet.pm:1.1506 Mon Mar 27 21:32:41 2023
+++ loncom/lonnet/perl/lonnet.pm Wed Apr 5 18:09:52 2023
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1506 2023/03/27 21:32:41 raeburn Exp $
+# $Id: lonnet.pm,v 1.1507 2023/04/05 18:09:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3869,10 +3869,15 @@
return;
}
} elsif (!$crsedit) {
+ if ($env{'request.role'} =~ m{^st\./$cdom/$cnum}) {
#
# No edit allowed where CC has switched to student role.
#
- return;
+ return;
+ } elsif (($resurl !~ m{^/res/$match_domain/$match_username/}) ||
+ ($resurl =~ m{^/res/lib/templates/})) {
+ return;
+ }
}
}
}
@@ -3898,7 +3903,7 @@
$forceedit = 1;
}
$cfile = $resurl;
- } elsif (($resurl ne '') && (&is_on_map($resurl))) {
+ } elsif (($resurl ne '') && (&is_on_map($resurl))) {
if ($resurl =~ m{^/adm/$match_domain/$match_username/\d+/smppg|bulletinboard$}) {
$incourse = 1;
if ($env{'form.forceedit'}) {
More information about the LON-CAPA-cvs
mailing list