You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/lib/NGCP/Panel/Controller/API/BannedUsersItem.pm

28 lines
552 B

package NGCP::Panel::Controller::API::BannedUsersItem;
use parent qw/NGCP::Panel::Role::EntitiesItem NGCP::Panel::Role::API::BannedUsers/;
use Sipwise::Base;
use HTTP::Status qw(:constants);
use NGCP::Panel::Utils::Security;
__PACKAGE__->set_config();
sub allowed_methods {
return [qw/GET OPTIONS HEAD DELETE/];
}
sub delete_item {
my($self, $c, $item, $old_resource, $resource, $form) = @_;
my $user = $item->{username};
NGCP::Panel::Utils::Security::user_unban($c, $user);
return 1;
}
1;
# vim: set tabstop=4 expandtab: