[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface/spreadsheet lonspreadsheet.pm
raeburn
raeburn at source.lon-capa.org
Tue Dec 14 07:59:21 EST 2021
raeburn Tue Dec 14 12:59:21 2021 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface/spreadsheet lonspreadsheet.pm
Log:
- For 2.11
Backport 1.66, 1.67
Index: loncom/interface/spreadsheet/lonspreadsheet.pm
diff -u loncom/interface/spreadsheet/lonspreadsheet.pm:1.61.6.2 loncom/interface/spreadsheet/lonspreadsheet.pm:1.61.6.3
--- loncom/interface/spreadsheet/lonspreadsheet.pm:1.61.6.2 Fri Aug 9 23:05:18 2013
+++ loncom/interface/spreadsheet/lonspreadsheet.pm Tue Dec 14 12:59:21 2021
@@ -1,5 +1,5 @@
#
-# $Id: lonspreadsheet.pm,v 1.61.6.2 2013/08/09 23:05:18 raeburn Exp $
+# $Id: lonspreadsheet.pm,v 1.61.6.3 2021/12/14 12:59:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -241,6 +241,29 @@
}
#
+ # Check if display of course gradebook is blocked
+ #
+
+ if ($env{'request.course.id'}) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('grades',$clientip,$cnum,$cdom);
+ if ($blocked) {
+ my $checkrole = "cm./$cdom/$cnum";
+ if ($env{'request.course.sec'} ne '') {
+ $checkrole .= "/$env{'request.course.sec'}";
+ }
+ unless ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) &&
+ ($env{'request.role'} !~ m{^st\./$cdom/$cnum})) {
+ &Apache::lonquickgrades::grades_blocked($r,$blocktext,'spreadsheet');
+ return OK;
+ }
+ }
+ }
+
+ #
# Do not allow users without vgr or mgr priv to continue unless
# grading type is set to spreadsheet.
#
More information about the LON-CAPA-cvs
mailing list