diff options
Diffstat (limited to 'Psso/Identity.php')
| -rw-r--r-- | Psso/Identity.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Psso/Identity.php b/Psso/Identity.php index 68272d4..a06f57e 100644 --- a/Psso/Identity.php +++ b/Psso/Identity.php @@ -4,9 +4,17 @@ namespace Psso; class Identity { public protected(set) string $user; public protected(set) array $groups; + public array $extras; - public function __construct(string $user, array $groups = []) { + public function __construct( + string $user, array $groups = [], array $extras = [] + ) { $this->user = $user; $this->groups = $groups; + $this->extras = $extras; + } + + public static function fromContext(Context $context) { + return new static($context->user, $context->groups, $context->extras); } } |
