Merge branch 'fix_2279_delete_camera_through_api' into storageareas
This commit is contained in:
commit
bc4fada34c
|
@ -207,8 +207,10 @@ class MonitorsController extends AppController {
|
||||||
if ( !$this->Monitor->exists() ) {
|
if ( !$this->Monitor->exists() ) {
|
||||||
throw new NotFoundException(__('Invalid monitor'));
|
throw new NotFoundException(__('Invalid monitor'));
|
||||||
}
|
}
|
||||||
if ( $this->Session->Read('systemPermission') != 'Edit' ) {
|
global $user;
|
||||||
throw new UnauthorizedException(__('Insufficient privileges'));
|
$canEdit = (!$user) || ($user['System'] == 'Edit');
|
||||||
|
if ( !$canEdit ) {
|
||||||
|
throw new UnauthorizedException(__('Insufficient privileges'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->request->allowMethod('post', 'delete');
|
$this->request->allowMethod('post', 'delete');
|
||||||
|
|
|
@ -59,8 +59,9 @@ public function add() {
|
||||||
|
|
||||||
if ($this->request->is('post')) {
|
if ($this->request->is('post')) {
|
||||||
|
|
||||||
if ($this->Session->Read('systemPermission') != 'Edit')
|
global $user;
|
||||||
{
|
$canEdit = (!$user) || ($user['System'] == 'Edit');
|
||||||
|
if ( !$canEdit ) {
|
||||||
throw new UnauthorizedException(__('Insufficient privileges'));
|
throw new UnauthorizedException(__('Insufficient privileges'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue