'nirObject' ]; public function __construct(Model $model, ?User $user = null) { $this->model = $model; $this->user = $user ?? Auth::user(); } public function get(): array { $rule = $this->rules[get_class($this->model)] ?? null; $func = "{$rule}Permissions"; if ($this->user->isPrivileged) return ['anything' => true]; elseif (method_exists($this, $func)) return $this->$func(); else return []; } public function nirObjectPermissions(): array { return ['edit' => $this->model->owner_id === $this->user->id]; } }