--- src/lib/Sympa/List.pm-DIST 2021-01-31 10:35:25.410915508 +0000 +++ src/lib/Sympa/List.pm 2021-01-31 10:35:28.442905538 +0000 @@ -3555,6 +3555,12 @@ # Deprecated. No longer used. #sub init_list_cache; +sub may_edit_cache { + my $self = shift; + + return($self->_load_edit_list_conf); +} + ## May the indicated user edit the indicated list parameter or not? sub may_edit { $log->syslog('debug3', '(%s, %s, %s)', @_); @@ -3571,9 +3577,7 @@ # Load edit_list.conf: Track by file, not domain (file may come from # server, robot, family or list context). my $edit_list_conf = - $self->_cache_get('edit_list_conf') - || $self->_cache_put('edit_list_conf', $self->_load_edit_list_conf) - || {}; + $options{_edit_list_conf_cache} || $self->_load_edit_list_conf || {}; my $role; --- src/lib/Sympa/List/Config.pm-DIST 2021-01-31 10:35:11.854960017 +0000 +++ src/lib/Sympa/List/Config.pm 2021-01-31 10:35:28.442905538 +0000 @@ -141,11 +141,14 @@ my $self = shift; my $user = shift; + my $list = $self->{context}; + my $cache = $list->may_edit_cache(); + my $pinfo = $self->SUPER::get_schema; if ($user) { foreach my $pname (CORE::keys %{$pinfo || {}}) { $self->_get_schema_apply_privilege($pinfo->{$pname}, [$pname], - $user, undef); + $user, undef, $cache); } } $pinfo; @@ -158,6 +161,7 @@ my $pnames = shift; my $user = shift; my $priv_p = shift; + my $cache = shift; my $list = $self->{context}; @@ -165,7 +169,8 @@ # - Trick: "hidden", "read" and "write" precede others in reverse # dictionary order. # - Internal parameters are not editable anyway. - my $priv = $list->may_edit(join('.', @{$pnames || []}), $user); + my $priv = $list->may_edit(join('.', @{$pnames || []}), $user, + _edit_list_conf_cache => $cache); $priv = 'read' if $pitem->{internal} and (not $priv or 'read' lt $priv); @@ -182,7 +187,7 @@ $self->_get_schema_apply_privilege( $pitem->{format}->{$key}, [@$pnames, $key], - $user, $pitem->{privilege} + $user, $pitem->{privilege}, $cache ); } }