'Mandanten-Administrator', self::Rentals => 'Vermietung', self::Content => 'Inhalte', }; } public function getDescription(): string { return match ($this) { self::Admin => 'Alles im eigenen Mandanten, inklusive Benutzerverwaltung', self::Rentals => 'Buchungen, Gäste, Preise, Angebote und Bewertungen', self::Content => 'Bilder, Texte, FAQ, Hinweise und Bewertungen', }; } public function grants(Permission $permission): bool { return in_array($permission, $this->permissions(), true); } /** * Abilities inside the current landlord. The operator is not a role here. * * @return list */ public function permissions(): array { return match ($this) { self::Admin => Permission::cases(), self::Rentals => [ Permission::Bookings, Permission::Properties, Permission::Guests, Permission::Reviews, Permission::Channels, ], self::Content => [ Permission::Content, Permission::Reviews, ], }; } }