mirror of https://github.com/MISP/MISP
Merge pull request #7090 from JakubOnderka/fix-saving-log
fix: [internal] Correctly save logpull/7095/head
commit
38f785ea63
|
@ -605,18 +605,18 @@ class SharingGroup extends AppModel
|
||||||
$authorisedToSave = $this->checkIfAuthorisedToSave($user, $sg);
|
$authorisedToSave = $this->checkIfAuthorisedToSave($user, $sg);
|
||||||
}
|
}
|
||||||
if (!$user['Role']['perm_site_admin'] &&
|
if (!$user['Role']['perm_site_admin'] &&
|
||||||
!($user['Role']['perm_sync'] && $syncLocal ) &&
|
!($user['Role']['perm_sync'] && $syncLocal) &&
|
||||||
!$authorisedToSave
|
!$authorisedToSave
|
||||||
) {
|
) {
|
||||||
$this->Log->create();
|
$this->Log->create();
|
||||||
$entry = array(
|
$entry = array(
|
||||||
'org' => $user['Organisation']['name'],
|
'org' => $user['Organisation']['name'],
|
||||||
'model' => 'SharingGroup',
|
'model' => 'SharingGroup',
|
||||||
'model_id' => $sg['SharingGroup']['uuid'],
|
'model_id' => 0,
|
||||||
'email' => $user['email'],
|
'email' => $user['email'],
|
||||||
'action' => 'error',
|
'action' => 'error',
|
||||||
'user_id' => $user['id'],
|
'user_id' => $user['id'],
|
||||||
'title' => 'Tried to save a sharing group but the user does not belong to it.'
|
'title' => "Tried to save a sharing group with UUID '{$sg['SharingGroup']['uuid']}' but the user does not belong to it."
|
||||||
);
|
);
|
||||||
$this->Log->save($entry);
|
$this->Log->save($entry);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue