access to manual topology for admins without port_control role

This commit is contained in:
Oliver Gorwits
2018-03-22 17:17:27 +00:00
parent 3ae4eabd39
commit b3457954a3
3 changed files with 8 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ use Dancer::Plugin::Auth::Extensible;
use App::Netdisco::JobQueue qw/jq_insert jq_userlog/;
ajax '/ajax/portcontrol' => require_role port_control => sub {
ajax '/ajax/portcontrol' => require_any_role [qw(admin port_control)] => sub {
send_error('No device/port/field', 400)
unless param('device') and (param('port') or param('field'));