allows($user); } public function view(User $user): bool { return $this->allows($user); } public function create(User $user): bool { return $this->allows($user); } public function update(User $user): bool { return $this->allows($user); } public function delete(User $user): bool { return $this->allows($user); } public function deleteAny(User $user): bool { return $this->allows($user); } public function reorder(User $user): bool { return $this->allows($user); } /** * Both questions, in one place: the role says what this user may do, TenantFeatures says what the * landlord has unlocked at all. An administrator of a landlord without the portal services does not * reach the portal screens either – no role grants what the landlord does not have. */ protected function allows(User $user): bool { if (! $user->currentRole()?->grants($this->permission())) { return false; } return app(TenantFeatures::class)->permits($this->permission()); } }