fix: Fixed a bug where normal users couldn't add object references

- as reported by @deralexxx
pull/2509/head
iglocska 2017-09-20 16:53:54 +02:00
parent 1770a501ab
commit 12b1c354fa
1 changed files with 1 additions and 4 deletions

View File

@ -34,10 +34,7 @@ class ObjectReferencesController extends AppController {
)
)
));
if (!$this->userRole['perm_add']) {
throw new MethodNotAllowedException('You don\'t have the required permissions to add object reference.');
}
if (empty($object) || (!$this->_isSiteAdmin() && $object['Event']['orgc_id'] != $this->Auth->user('orgc_id'))) {
if (empty($object) || (!$this->_isSiteAdmin() && $object['Event']['orgc_id'] != $this->Auth->user('org_id'))) {
throw new MethodNotAllowedException('Invalid object.');
}
$this->set('objectId', $objectId);