fix: [Sightings] Plugin.Sightings_policy=Event Owner now shows sightings

that belong to the creating org
pull/5032/head
mokaddem 2019-08-26 16:49:30 +02:00
parent 37f474280d
commit b51871fe52
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 1 deletions

View File

@ -517,7 +517,10 @@ class Sighting extends AppModel
));
$eventOwnerOrgIdList[$temp_event['Event']['id']] = $temp_event['Event']['orgc_id'];
}
if (empty($eventOwnerOrgIdList[$sighting['Sighting']['event_id']]) || $eventOwnerOrgIdList[$sighting['Sighting']['event_id']] !== $user['org_id']) {
if (
empty($eventOwnerOrgIdList[$sighting['Sighting']['event_id']]) ||
($eventOwnerOrgIdList[$sighting['Sighting']['event_id']] !== $user['org_id'] && $sighting['Sighting']['org_id'] !== $user['org_id'])
) {
unset($sightings[$k]);
}
}