Implemented echoarea/filearea security
This commit is contained in:
@@ -112,18 +112,25 @@ class File extends Model
|
||||
}
|
||||
|
||||
// See if we need to export this message.
|
||||
$exportto = $model->filearea->addresses->pluck('id')->diff($model->set_seenby);
|
||||
if ($model->filearea->sec_read) {
|
||||
$exportto = $model
|
||||
->filearea
|
||||
->addresses
|
||||
->filter(function($item) use ($model) { return $item->security >= $model->echoarea->sec_read; })
|
||||
->pluck('id')
|
||||
->diff($model->set_seenby);
|
||||
|
||||
if ($exportto->count()) {
|
||||
if ($model->no_export) {
|
||||
Log::debug(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
|
||||
return;
|
||||
if ($exportto->count()) {
|
||||
if ($model->no_export) {
|
||||
Log::debug(sprintf('%s:- NOT processing exporting of message by configuration [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
|
||||
return;
|
||||
}
|
||||
|
||||
Log::debug(sprintf('%s:- Exporting file [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
|
||||
|
||||
// Save the seenby for the exported systems
|
||||
$model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE);
|
||||
}
|
||||
|
||||
Log::debug(sprintf('%s:- Exporting file [%s] to [%s]',self::LOGKEY,$model->id,$exportto->join(',')));
|
||||
|
||||
// Save the seenby for the exported systems
|
||||
$model->seenby()->syncWithPivotValues($exportto,['export_at'=>Carbon::now()],FALSE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user