From f304610a88889fa9f2731889afe5d147adcaccf9 Mon Sep 17 00:00:00 2001 From: ArrayIterator <37867551+ArrayIterator@users.noreply.github.com> Date: Fri, 19 Jul 2024 01:53:47 +0700 Subject: [PATCH] Update CapabilityInterface.php --- .../Roles/Interfaces/CapabilityInterface.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Auth/Roles/Interfaces/CapabilityInterface.php b/src/Auth/Roles/Interfaces/CapabilityInterface.php index 16e86a5..3cb68fa 100644 --- a/src/Auth/Roles/Interfaces/CapabilityInterface.php +++ b/src/Auth/Roles/Interfaces/CapabilityInterface.php @@ -5,13 +5,45 @@ interface CapabilityInterface { + /** + * Check if the capability has a role + * + * @param RoleInterface|string $role + * @return bool + */ public function has(RoleInterface|string $role) : bool; + /** + * Add a role to the capability + * @param RoleInterface|string $role + */ + public function add(RoleInterface|string $role); + + /** + * Get role identity + * + * @return string + */ public function getIdentity(): string; + /** + * Get capability name + * + * @return string + */ public function getName(): string; + /** + * Get capability description + * + * @return string|null + */ public function getDescription(): ?string; + /** + * Get list of roles + * + * @return iterable + */ public function getRoles() : iterable; }