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

raeburn lon-capa-cvs@mail.lon-capa.org
Wed, 19 Jul 2006 19:44:52 -0000


raeburn		Wed Jul 19 15:44:52 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Browse access to group portfolio files for mdg or vcg priv in course.  Removing unneeded groupuri code (functionality already provided by courseuri check preceding the eliminated code).
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.761 loncom/lonnet/perl/lonnet.pm:1.762
--- loncom/lonnet/perl/lonnet.pm:1.761	Fri Jul  7 17:55:23 2006
+++ loncom/lonnet/perl/lonnet.pm	Wed Jul 19 15:44:52 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.761 2006/07/07 21:55:23 raeburn Exp $
+# $Id: lonnet.pm,v 1.762 2006/07/19 19:44:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3274,7 +3274,7 @@
         return 'F';
     }
 
-# bre access to group if user has rgf priv for this group and course.
+# bre access to group portfolio for rgf priv in group, or mdg or vcg in course.
     if (($space=~/^(uploaded|editupload)$/) && ($dir[0] eq 'groups') 
          && ($dir[2] eq 'portfolio') && ($priv eq 'bre')) {
         if (exists($env{'request.course.id'})) {
@@ -3286,6 +3286,14 @@
                 if ($env{'user.priv.'.$env{'request.role'}.'./'.$courseprivid
                     .'/'.$dir[1]} =~/rgf\&([^\:]*)/) {
                     return $1; 
+                } else {
+                    if ($env{'request.course.sec'}) {
+                        $courseprivid.='/'.$env{'request.course.sec'};
+                    }
+                    if ($env{'user.priv.'.$env{'request.role'}.'./'.
+                        $courseprivid} =~/(mdg|vcg)\&([^\:]*)/) {
+                        return $2;
+                    }
                 }
             }
         }
@@ -3354,14 +3362,6 @@
        $thisallowed.=$1;
     }
 
-# Group: uri itself is a group
-    my $groupuri=$uri;
-    $groupuri=~s/^([^\/])/\/$1/;
-    if ($env{'user.priv.'.$env{'request.role'}.'.'.$groupuri}
-       =~/\Q$priv\E\&([^\:]*)/) {
-       $thisallowed.=$1;
-    }
-
 # URI is an uploaded document for this course, default permissions don't matter
 # not allowing 'edit' access (editupload) to uploaded course docs
     if (($priv eq 'bre') && ($uri=~m|^uploaded/|)) {