Skip to content

Commit

Permalink
Update AccessRule.php
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkSide666 authored Jan 15, 2020
1 parent cbf427a commit fe4476e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Model/AccessRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,12 @@ public function init()
// Specify which conditions will be applied on the model, e.g. "status=DRAFT AND sent=true OR status=SENT"
// @TODO this will be replaced by JSON structure when Alain will develop such JS widget
$this->addField('conditions', ['type' => 'text']);

// cleanup data
$this->addHook('beforeSave', function ($m) {
if ($m['all_visible']) $m['visible_fields'] = null;
if ($m['all_editable']) $m['editable_fields'] = null;
if ($m['all_actions']) $m['actions'] = null;
});
}
}

0 comments on commit fe4476e

Please sign in to comment.