[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Mon Oct 31 09:44:37 EDT 2011


raeburn		Mon Oct 31 13:44:37 2011 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Direct edit resource access to unblocked CSTR spaces for DC (bug 5842).
  - Re-instate functionality following changes in loncacc.pm (rev 1.54 and 1.55).
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.355 loncom/interface/lonmenu.pm:1.356
--- loncom/interface/lonmenu.pm:1.355	Sun Oct 30 22:15:20 2011
+++ loncom/interface/lonmenu.pm	Mon Oct 31 13:44:30 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.355 2011/10/30 22:15:20 raeburn Exp $
+# $Id: lonmenu.pm,v 1.356 2011/10/31 13:44:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -491,9 +491,12 @@
                     $uploaded = &is_course_upload($file,$cnum,$cdom);
                 }
                 if (!$uploaded) {
-                    $file=~s/^($match_domain)\/($match_username)/\/priv\/$1\/$2/;
+                 
+                    $file=~s{^($match_domain)/($match_username)}{/priv/$1/$2};
+
                     # Check that the user has permission to edit this resource
-                    ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file);
+                    my $setpriv = 1;
+                    ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$setpriv);
                     if (defined($cfudom)) {
 		        $home=&Apache::lonnet::homeserver($cfuname,$cfudom);
 		        my $allowed=0;
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1140 loncom/lonnet/perl/lonnet.pm:1.1141
--- loncom/lonnet/perl/lonnet.pm:1.1140	Mon Oct 24 12:05:58 2011
+++ loncom/lonnet/perl/lonnet.pm	Mon Oct 31 13:44:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1140 2011/10/24 12:05:58 www Exp $
+# $Id: lonnet.pm,v 1.1141 2011/10/31 13:44:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5910,6 +5910,15 @@
         }
     }
 
+# User who is not author or co-author might still be able to edit
+# resource of an author in the domain (e.g., if Domain Coordinator).
+    if (($priv eq 'eco') && ($thisallowed eq '') && ($env{'request.course.id'}) &&
+        (&allowed('mdc',$env{'request.course.id'}))) {
+        if ($env{"user.priv.cm./$uri/"}=~/\Q$priv\E\&([^\:]*)/) {
+            $thisallowed.=$1;
+        }
+    }
+
 # Course: uri itself is a course
     my $courseuri=$uri;
     $courseuri=~s/\_(\d)/\/$1/;




More information about the LON-CAPA-cvs mailing list