FactoidCommands: allow non-admins to inspect factset values on factoids they do not own, and to be able to factset `admin` on any factoids instead of using factchange

This commit is contained in:
Pragmatic Software 2019-05-08 13:06:30 -07:00
parent 15aaa6fa1a
commit 02c8cfd83b
1 changed files with 2 additions and 3 deletions

View File

@ -52,7 +52,6 @@ our %factoid_metadata_levels = (
'effective-level' => 20,
'persist-key' => 20,
'interpolate' => 10,
'action' => 10,
# all others are allowed to be factset by anybody/default to level 0
);
@ -573,12 +572,12 @@ sub factset {
}
}
if(defined $owner_channel) {
if (defined $owner_channel) {
my $factoid = $self->{pbot}->{factoids}->{factoids}->hash->{$owner_channel}->{$owner_trigger};
my ($owner) = $factoid->{'owner'} =~ m/([^!]+)/;
if(lc $nick ne lc $owner and $level == 0) {
if ((defined $value and $key ne 'action') and lc $nick ne lc $owner and $level == 0) {
return "You are not the owner of $trigger.";
}
}