chg: [internal] Use cached sharing groups IDs when fetching objects

pull/6326/head
Jakub Onderka 2020-09-20 18:43:07 +02:00
parent f52eee457a
commit 08e2a18b2c
1 changed files with 2 additions and 2 deletions

View File

@ -455,9 +455,9 @@ class MispObject extends AppModel
// group
public function fetchObjects($user, $options = array())
{
$sgsids = $this->SharingGroup->fetchAllAuthorised($user);
$attributeConditions = array();
if (!$user['Role']['perm_site_admin']) {
$sgids = $this->Event->cacheSgids($user, true);
$attributeConditions = array(
'OR' => array(
array(
@ -468,7 +468,7 @@ class MispObject extends AppModel
'Attribute.distribution' => array(1, 2, 3, 5),
array(
'Attribute.distribution' => 4,
'Attribute.sharing_group_id' => $sgsids
'Attribute.sharing_group_id' => $sgids,
)
)
)