Arachne / Security

Authentication and authorization for Nette framework. Deals with cases that are difficult to implement with nette/security.
MIT License
2 stars 7 forks source link

TypeError:: isAllowed type hint string no allowed Nette\Security\IAuthorizator::ALL #2

Closed duskohu closed 6 years ago

duskohu commented 6 years ago

when I use ->isAllowed('resource', Nette\Security\IAuthorizator::ALL); I have TypeError:: isAllowed() must be of the type string, null given https://github.com/Arachne/Security/blob/v0.4.0/src/Authorization/AuthorizatorInterface.php#L17 https://github.com/nette/security/blob/v2.4.2/src/Security/IAuthorizator.php#L18

enumag commented 6 years ago

Ups, looks like I missed that. Can you change the typehint to ?string? PHP 7.1 is already required anyway.

enumag commented 6 years ago

After reconsidering I've reverted the change. It doesn't make much sense to ask if someone has all privileges on a resource. You should add another more specific privilege instead.