chg: [attribute:editAttribute] Uage of `editableFields` instead of

hardcoded array
pull/6143/head
mokaddem 2020-07-24 10:59:42 +02:00
parent ac31e9ae92
commit 0086fcd1dd
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 19 deletions

View File

@ -4267,25 +4267,11 @@ class Attribute extends AppModel
$attribute['distribution'] = 5;
}
}
$fieldList = array(
'event_id',
'category',
'type',
'value',
'value1',
'value2',
'to_ids',
'uuid',
'revision',
'distribution',
'timestamp',
'comment',
'sharing_group_id',
'deleted',
'disable_correlation',
'first_seen',
'last_seen'
);
$fieldList = $this->editableFields;
if (empty($existingAttribute)) {
$addableFieldList = array('event_id', 'type', 'uuid');
$fieldList = array_merge($fieldList, $addableFieldList);
}
if ($objectId) {
$fieldList[] = 'object_id';
$fieldList[] = 'object_relation';