Skip to content

Commit

Permalink
fix: Use loadPolicyArray instead of loadPolicyLine
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Jan 5, 2022
1 parent 03492ae commit 9b635f2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/adapter/DatabaseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ public function savePolicyLine($ptype, array $rule)
*/
public function loadPolicy(Model $model): void
{
$rows = $this->model->cache('tauthz')->select()->toArray();
$rows = $this->model->cache('tauthz')->field(['ptype', 'v0', 'v1', 'v2', 'v3', 'v4', 'v5'])->select()->toArray();
foreach ($rows as $row) {
$line = implode(', ', array_filter(array_slice($row, 1), function ($val) {
return '' != $val && !is_null($val);
}));
$this->loadPolicyLine(trim($line), $model);
$this->loadPolicyArray($this->filterRule($row), $model);
}
}

Expand Down

0 comments on commit 9b635f2

Please sign in to comment.