Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types=1);
- namespace App\Policy;
- use App\Model\Entity\Manage;
- use Authorization\IdentityInterface;
- /**
- * Manage policy
- */
- class ManagePolicy
- {
- public function canIndex(IdentityInterface $user, ManageController $manageController)
- {
- return true;
- }
- /**
- * Check if $user can add Manage
- *
- * @param \Authorization\IdentityInterface $user The user.
- * @param \App\Model\Entity\Manage $manage
- * @return bool
- */
- public function canAdd(IdentityInterface $user, Manage $manage)
- {
- }
- /**
- * Check if $user can edit Manage
- *
- * @param \Authorization\IdentityInterface $user The user.
- * @param \App\Model\Entity\Manage $manage
- * @return bool
- */
- public function canEdit(IdentityInterface $user, Manage $manage)
- {
- }
- /**
- * Check if $user can delete Manage
- *
- * @param \Authorization\IdentityInterface $user The user.
- * @param \App\Model\Entity\Manage $manage
- * @return bool
- */
- public function canDelete(IdentityInterface $user, Manage $manage)
- {
- }
- /**
- * Check if $user can view Manage
- *
- * @param \Authorization\IdentityInterface $user The user.
- * @param \App\Model\Entity\Manage $manage
- * @return bool
- */
- public function canView(IdentityInterface $user, Manage $manage)
- {
- if($user->get('role') = 'root' || $user->get('role') = 'admin' || $user->get('role') = 'manager')
- }
- public function userLevel(IdentityInterface $identity)
- {
- return $identity->get('role');
- }
- }
Add Comment
Please, Sign In to add comment