-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding base ACL policy which is detached from entities and performs c…
…hecks only on the identity.
- Loading branch information
1 parent
adce06d
commit a48ded4
Showing
7 changed files
with
62 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Security\Policies; | ||
|
||
use App\Model\Entity\Instance; | ||
use App\Model\Entity\User; | ||
use App\Security\Identity; | ||
use App\Security\Roles; | ||
|
||
/** | ||
* Base policy is not bound to particular entity. | ||
* It gathers generic checks performed solely on the entity of the logged-in user. | ||
*/ | ||
class BasePermissionPolicy implements IPermissionPolicy | ||
{ | ||
public function getAssociatedClass() | ||
{ | ||
return ''; | ||
} | ||
|
||
public function userIsNotGroupLocked(Identity $identity): bool | ||
{ | ||
$user = $identity->getUserData(); | ||
return $user && !$user->isGroupLocked(); | ||
} | ||
} |
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
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