diff --git a/security/src/Security/Policy/Can.php b/security/src/Security/Policy.php similarity index 74% rename from security/src/Security/Policy/Can.php rename to security/src/Security/Policy.php index eaf8ea2..d4758f2 100644 --- a/security/src/Security/Policy/Can.php +++ b/security/src/Security/Policy.php @@ -14,18 +14,18 @@ * file that was distributed with this source code. */ -namespace Castor\Security\Policy; +namespace Castor\Security; #[\Attribute(\Attribute::TARGET_FUNCTION | \Attribute::TARGET_METHOD)] -class Can +class Policy { /** - * @param Can[]|string[] $andX - * @param Can[]|string[] $orX + * @param Policy[]|array $andCan + * @param Policy[]|array $orCan */ public function __construct( - public array $andX = [], - public array $orX = [] + public array $andCan = [], + public array $orCan = [] ) { } } diff --git a/security/src/Security/Policy/Checker.php b/security/src/Security/Policy/Authorizer.php similarity index 63% rename from security/src/Security/Policy/Checker.php rename to security/src/Security/Policy/Authorizer.php index f5dcee3..d2dee20 100644 --- a/security/src/Security/Policy/Checker.php +++ b/security/src/Security/Policy/Authorizer.php @@ -16,10 +16,16 @@ namespace Castor\Security\Policy; +use Castor\Security\Policy; + /** - * The policy checker can be implemented by identities that support policy checking. + * The Authorized MUST be implemented by Identities that support policy checking. */ -interface Checker +interface Authorizer { - public function checkIt(Can $can): bool; + /** + * @param Policy $policy + * @return bool + */ + public function isAuthorized(Policy $policy): bool; }