--- loncom/lonnet/perl/lonnet.pm 2023/03/27 21:32:41 1.1506 +++ loncom/lonnet/perl/lonnet.pm 2023/04/05 18:09:52 1.1507 @@ -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 @@ sub can_edit_resource { 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 @@ sub can_edit_resource { $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'}) {