-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eric Richer [email protected] <[email protected]>
- Loading branch information
Showing
56 changed files
with
438 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,16 +27,13 @@ | |
/** | ||
* Interface that you can implement for dynamic assertions | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @author Aeneas Rekkas | ||
* @author Daniel Gimenes <[email protected]> | ||
* @licence MIT | ||
*/ | ||
interface AssertionInterface | ||
{ | ||
public function assert( | ||
PermissionInterface|string $permission, | ||
IdentityInterface $identity = null, | ||
?IdentityInterface $identity = null, | ||
mixed $context = null | ||
): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,6 @@ | |
/** | ||
* Base exception interface for LmcRbac | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
interface ExceptionInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,6 @@ | |
|
||
/** | ||
* InvalidArgumentException | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,9 @@ | |
|
||
/** | ||
* Exception that is thrown when a role cannot be found (for instance from a provider) | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
class RoleNotFoundException extends BaseRuntimeException implements ExceptionInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
/** @var string */ | ||
protected $message = 'No role could be found'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,6 @@ | |
/** | ||
* RuntimeException | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
class RuntimeException extends BaseRuntimeException implements ExceptionInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,6 @@ | |
/** | ||
* Interface for an identity | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
interface IdentityInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,19 +22,16 @@ | |
namespace Lmc\Rbac\Options; | ||
|
||
use Laminas\Stdlib\AbstractOptions; | ||
use Lmc\Rbac\Role\InMemoryRoleProvider; | ||
|
||
/** | ||
* Options for LmcRbac module | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
class ModuleOptions extends AbstractOptions | ||
{ | ||
/** | ||
* Guest role (used when no identity is found) | ||
* | ||
* @var string | ||
*/ | ||
protected string $guestRole = 'guest'; | ||
|
||
|
@@ -52,7 +49,7 @@ class ModuleOptions extends AbstractOptions | |
* @var array | ||
*/ | ||
protected array $roleProvider = [ | ||
'Lmc\Rbac\Role\InMemoryRoleProvider' => [], | ||
InMemoryRoleProvider::class => [], | ||
]; | ||
|
||
/** | ||
|
@@ -71,7 +68,6 @@ public function __construct($options = null) | |
* Set the assertions options | ||
* | ||
* @param array $assertionMap | ||
* @return void | ||
*/ | ||
public function setAssertionMap(array $assertionMap): void | ||
{ | ||
|
@@ -90,9 +86,6 @@ public function getAssertionMap(): array | |
|
||
/** | ||
* Set the guest role (used when no identity is found) | ||
* | ||
* @param string $guestRole | ||
* @return void | ||
*/ | ||
public function setGuestRole(string $guestRole): void | ||
{ | ||
|
@@ -101,8 +94,6 @@ public function setGuestRole(string $guestRole): void | |
|
||
/** | ||
* Get the guest role (used when no identity is found) | ||
* | ||
* @return string | ||
*/ | ||
public function getGuestRole(): string | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,10 @@ | |
|
||
namespace Lmc\Rbac\Options; | ||
|
||
use Lmc\Rbac\Options\ModuleOptions; | ||
use Psr\Container\ContainerInterface; | ||
|
||
/** | ||
* Factory for the module options | ||
* | ||
* @author Michaël Gallego <[email protected]> | ||
* @licence MIT | ||
*/ | ||
class ModuleOptionsFactory | ||
{ | ||
|
Oops, something went wrong.