fix: [attackMatrix] do not throw an error for an edge case where the

user did not have full permission
pull/4024/head
mokaddem 2019-01-17 14:04:01 +01:00
parent 4edc93f325
commit 8708d5133c
1 changed files with 3 additions and 2 deletions

View File

@ -4590,8 +4590,9 @@ class EventsController extends AppController
if ($scope == 'event') {
$eventId = $scope_id;
} elseif ($scope == 'attribute') {
$attribute = $this->Event->Attribute->fetchAttributesSimple($this->Auth->user(), array(
'conditions' => array('Attribute.id' => $scope_id)
$attribute = $this->Event->Attribute->fetchAttributes($this->Auth->user(), array(
'conditions' => array('Attribute.id' => $scope_id),
'fields' => array('event_id')
));
if (empty($attribute)) {
throw new Exception("Invalid Attribute.");