Merge branch '30-add-acl-checking-on-job-order-list-views' into 'master'
Resolve "Add ACL checking on Job Order list views" Closes #30 See merge request jankstudio/resq!29
This commit is contained in:
commit
8974a68260
3 changed files with 19 additions and 11 deletions
|
|
@ -40,10 +40,7 @@ class JobOrderController extends BaseController
|
|||
{
|
||||
public function getJobOrders(Request $req)
|
||||
{
|
||||
if (!$this->isGranted('jo_in.list')) {
|
||||
$exception = $this->createAccessDeniedException('No access.');
|
||||
throw $exception;
|
||||
}
|
||||
$this->denyAccessUnlessGranted('jo_in.list', null, 'No access.');
|
||||
|
||||
// get search term
|
||||
$term = $req->query->get('search');
|
||||
|
|
@ -147,7 +144,6 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function incomingSubmit(Request $req, ValidatorInterface $validator, InvoiceCreator $ic)
|
||||
{
|
||||
error_log(print_r($req->request->all(), true));
|
||||
$this->denyAccessUnlessGranted('jo_in.list', null, 'No access.');
|
||||
|
||||
// initialize error list
|
||||
|
|
@ -342,6 +338,8 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function listAssigning()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_assign.list', null, 'No access.');
|
||||
|
||||
$params = $this->initParameters('jo_assign');
|
||||
|
||||
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
|
||||
|
|
@ -351,6 +349,8 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function listFulfillment()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_fulfill.list', null, 'No access.');
|
||||
|
||||
$params = $this->initParameters('jo_fulfill');
|
||||
|
||||
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
|
||||
|
|
@ -360,6 +360,8 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function listOpen()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_open.list', null, 'No access.');
|
||||
|
||||
$params = $this->initParameters('jo_open');
|
||||
|
||||
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
|
||||
|
|
@ -370,6 +372,8 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function listAll()
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_all.list', null, 'No access.');
|
||||
|
||||
$params = $this->initParameters('jo_all');
|
||||
|
||||
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
|
||||
|
|
@ -852,11 +856,11 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function fulfillmentForm(MapTools $map_tools, $id)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_assign.list', null, 'No access.');
|
||||
$this->denyAccessUnlessGranted('jo_fulfill.list', null, 'No access.');
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$params = $this->initParameters('jo_assign');
|
||||
$params = $this->initParameters('jo_fulfill');
|
||||
$params['mode'] = 'update-fulfillment';
|
||||
|
||||
// get row data
|
||||
|
|
@ -901,7 +905,7 @@ class JobOrderController extends BaseController
|
|||
|
||||
public function fulfillmentSubmit(Request $req, ValidatorInterface $validator, $id)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_assign.list', null, 'No access.');
|
||||
$this->denyAccessUnlessGranted('jo_fulfill.list', null, 'No access.');
|
||||
|
||||
// initialize error list
|
||||
$error_array = [];
|
||||
|
|
|
|||
|
|
@ -111,7 +111,9 @@
|
|||
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View / Edit"><i class="la la-edit"></i></a>';
|
||||
|
||||
{% if is_granted('jo_assign.unlock') %}
|
||||
actions += '<a href="' + row.meta.unlock_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="Unlock"><i class="fa fa-unlock"></i></a>';
|
||||
if (row.meta.unlock_url != '') {
|
||||
actions += '<a href="' + row.meta.unlock_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="Unlock"><i class="fa fa-unlock"></i></a>';
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
return actions;
|
||||
|
|
|
|||
|
|
@ -106,8 +106,10 @@
|
|||
template: function (row, index, datatable) {
|
||||
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View / Edit"><i class="la la-edit"></i></a>';
|
||||
|
||||
{% if row.meta.unlock_url != "" && is_granted('jo_proc.unlock') %}
|
||||
actions += '<a href="' + row.meta.unlock_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="Unlock"><i class="fa fa-unlock"></i></a>';
|
||||
{% if is_granted('jo_proc.unlock') %}
|
||||
if (row.meta.unlock_url != '') {
|
||||
actions += '<a href="' + row.meta.unlock_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="Unlock"><i class="fa fa-unlock"></i></a>';
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
return actions;
|
||||
|
|
|
|||
Loading…
Reference in a new issue