Skip to content

Commit e12c29d

Browse files
jlopes90lonnieezell
authored andcommitted
add exception permission and group
1 parent 540fa25 commit e12c29d

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/Authorization/AuthorizationException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ public static function forUnknownPermission(string $permission): self
1919
{
2020
return new self(lang('Auth.unknownPermission', [$permission]));
2121
}
22+
23+
public static function forUnauthorized(): self
24+
{
25+
return new self(lang('Auth.notEnoughPrivilege'));
26+
}
2227
}

src/Exceptions/GroupException.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace CodeIgniter\Shield\Exceptions;
6+
7+
use CodeIgniter\Shield\Authorization\AuthorizationException;
8+
9+
class GroupException extends AuthorizationException
10+
{
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace CodeIgniter\Shield\Exceptions;
6+
7+
use CodeIgniter\Shield\Authorization\AuthorizationException;
8+
9+
class PermissionException extends AuthorizationException
10+
{
11+
}

0 commit comments

Comments
 (0)