Merge pull request #2426 from webmin/dev/noacl

Add `noacl` support
This commit is contained in:
Jamie Cameron
2025-02-27 17:04:22 -08:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

View File

@@ -1299,6 +1299,19 @@ foreach my $u (split(/\s+/, $access{'users'})) {
return 0;
}
=head2 can_module_acl(&mod)
Returns 1 if the given module has ability to manage its own ACLs.
=cut
sub can_module_acl
{
my ($mod) = @_;
my $mdir = &module_root_directory($mod);
return 1 if (-f "$mdir/acl_security.pl" || -f "$mdir/config.info");
return 0;
}
=head2 open_session_db(\%miniserv)
Opens the session database, and ties it to the sessiondb hash. Parameters are :

View File

@@ -392,6 +392,7 @@ foreach my $c (sort { $b cmp $a } @cats) {
my @grid = ( );
my $sw = 0;
foreach my $m (@cmlist) {
next if ($m->{'noacl'});
my $md = $m->{'dir'};
my $fromgroup = $memg &&
&indexof($md, @{$memg->{'modules'}}) >= 0;
@@ -403,7 +404,8 @@ foreach my $c (sort { $b cmp $a } @cats) {
}
elsif ($mcan{$md}) {
my $label;
if ($access{'acl'} && $in{'user'} && !$safe) {
if ($access{'acl'} && $in{'user'} && !$safe &&
&can_module_acl($m)) {
# Show link for editing ACL
$label = ui_link("edit_acl.cgi?" .
"mod=" . urlize($m->{'dir'}) .