Merge branch 'fix_2279_delete_camera_through_api' into storageareas
This commit is contained in:
commit
bc4fada34c
|
@ -207,7 +207,9 @@ 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;
|
||||||
|
$canEdit = (!$user) || ($user['System'] == 'Edit');
|
||||||
|
if ( !$canEdit ) {
|
||||||
throw new UnauthorizedException(__('Insufficient privileges'));
|
throw new UnauthorizedException(__('Insufficient privileges'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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