diff --git a/lib/NGCP/Panel/Controller/Root.pm b/lib/NGCP/Panel/Controller/Root.pm index 64e77cbe99..acc8a1383a 100644 --- a/lib/NGCP/Panel/Controller/Root.pm +++ b/lib/NGCP/Panel/Controller/Root.pm @@ -52,6 +52,15 @@ sub auto :Private { $c->log->debug("*** Root::auto grant access for authenticated user"); + # check for read_only on write operations + if($c->user->read_only && ( + $c->req->uri->path =~ /create/ + || $c->req->uri->path =~ /edit/ + || $c->req->uri->path =~ /delete/ + )) { + $c->detach('/denied_page'); + } + # load top menu widgets my $plugin_finder = NGCP::Panel::Widget->new; my $topmenu_templates = [];