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

raeburn raeburn at source.lon-capa.org
Fri Mar 29 13:32:03 EDT 2024


raeburn		Fri Mar 29 17:32:03 2024 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Allowed editors for co-author access to Authpring Space:
    - For coauthor roles, if authoreditors is absent in environment.db for the
      Authoring Space's author, use domain default, or if not yet set, default
      to edit,xml.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1523 loncom/lonnet/perl/lonnet.pm:1.1524
--- loncom/lonnet/perl/lonnet.pm:1.1523	Sat Feb 24 23:41:44 2024
+++ loncom/lonnet/perl/lonnet.pm	Fri Mar 29 17:32:03 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1523 2024/02/24 23:41:44 raeburn Exp $
+# $Id: lonnet.pm,v 1.1524 2024/03/29 17:32:03 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7009,6 +7009,7 @@
     my %allroles=();
     my %allgroups=();
     my %gotcoauconfig=();
+    my %domdefaults=();
 
     for my $area (grep { ! /^rolesdef_/ } keys(%rolesdump)) {
         my $role = $rolesdump{$area};
@@ -7071,6 +7072,20 @@
                             my $name = $item;
                             if ($item eq 'authoreditors') {
                                 $name = 'editors';
+                                unless ($info{'authoreditors'}) {
+                                    my %domdefs;
+                                    if (ref($domdefaults{$audom}) eq 'HASH') {
+                                        %domdefs = %{$domdefaults{$audom}};
+                                    } else {
+                                        %domdefs = &get_domain_defaults($audom);
+                                        $domdefaults{$audom} = \%domdefs;
+                                    }
+                                    if ($domdefs{$name} ne '') {
+                                        $info{'authoreditors'} = $domdefs{$name};
+                                    } else {
+                                        $info{'authoreditors'} = 'edit,xml';
+                                    }
+                                }
                             }
                             $coauthorenv{"environment.internal.$name.$area"} = $info{$item};
                         }




More information about the LON-CAPA-cvs mailing list