From 9b86da6047785bf340a96cd1f4faed9ebad015d2 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 3 Feb 2020 18:13:03 -0800 Subject: [PATCH] Users: allow botowner to userset/userunset capabilities they do not have --- PBot/Users.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBot/Users.pm b/PBot/Users.pm index f148ba6c..e040184d 100644 --- a/PBot/Users.pm +++ b/PBot/Users.pm @@ -410,7 +410,7 @@ sub userset { } if ($self->{pbot}->{capabilities}->exists($key) and not $self->{pbot}->{capabilities}->userhas($u, $key)) { - return "To set the $key capability your user account must also have it."; + return "To set the $key capability your user account must also have it." unless $self->{pbot}->{capabilities}->userhas($u, 'botowner'); } my ($found_channel, $found_hostmask) = $self->find_user_account($channel, $hostmask); @@ -456,7 +456,7 @@ sub userunset { } if (defined $key and $self->{pbot}->{capabilities}->exists($key) and not $self->{pbot}->{capabilities}->userhas($u, $key)) { - return "To unset the $key capability your user account must also have it."; + return "To unset the $key capability your user account must also have it." unless $self->{pbot}->{capabilities}->userhas($u, 'botowner'); } my ($found_channel, $found_hostmask) = $self->find_user_account($channel, $hostmask);