mirror of https://github.com/MISP/MISP
Merge pull request #8046 from RichieB2B/ncsc-nl/sightings-dist
Use Event model for Sighting contextpull/8052/head
commit
22576b81ba
|
@ -4312,12 +4312,16 @@ class Event extends AppModel
|
|||
// If the distribution is sharing group only, check if the sync user is in the sharing group or not, return true if yes, false if no
|
||||
public function checkDistributionForPush($object, $server, $context = 'Event')
|
||||
{
|
||||
$model = $context
|
||||
if ($context === 'Sighting') {
|
||||
$model = 'Event'
|
||||
}
|
||||
if (empty(Configure::read('MISP.host_org_id')) || !$server['Server']['internal'] || Configure::read('MISP.host_org_id') != $server['Server']['remote_org_id']) {
|
||||
if ($context != 'Sighting' && $object[$context]['distribution'] < 2) {
|
||||
if ($context != 'Sighting' && $object[$model]['distribution'] < 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($object[$context]['distribution'] == 4) {
|
||||
if ($object[$model]['distribution'] == 4) {
|
||||
if ($context === 'Event' || $context === 'Sighting') {
|
||||
return $this->SharingGroup->checkIfServerInSG($object['SharingGroup'], $server);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue