From 0bdebdf9ddbe173e8f0e059f45ab3ad998e61a2c Mon Sep 17 00:00:00 2001 From: Hasby Maulana Date: Thu, 26 Oct 2023 11:45:09 +0700 Subject: [PATCH] Update ACLAdminController.php --- .../Controllers/Admin/ACLAdminController.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/stubs/app/Http/Controllers/Admin/ACLAdminController.php b/stubs/app/Http/Controllers/Admin/ACLAdminController.php index 1b40395..3e19386 100644 --- a/stubs/app/Http/Controllers/Admin/ACLAdminController.php +++ b/stubs/app/Http/Controllers/Admin/ACLAdminController.php @@ -16,22 +16,22 @@ class ACLAdminController extends Controller /** * @var \Tripteki\ACL\Contracts\Repository\Admin\IACLRoleRepository */ - protected $ruleRoleAdminRepository; + protected $aclRoleAdminRepository; /** * @var \Tripteki\ACL\Contracts\Repository\IACLRepository */ - protected $ruleUserAdminRepository; + protected $aclUserAdminRepository; /** - * @param \Tripteki\ACL\Contracts\Repository\Admin\IACLRoleRepository $ruleRoleAdminRepository - * @param \Tripteki\ACL\Contracts\Repository\IACLRepository $ruleUserAdminRepository + * @param \Tripteki\ACL\Contracts\Repository\Admin\IACLRoleRepository $aclRoleAdminRepository + * @param \Tripteki\ACL\Contracts\Repository\IACLRepository $aclUserAdminRepository * @return void */ - public function __construct(IACLRuleRoleRepository $ruleRoleAdminRepository, IACLRuleUserRepository $ruleUserAdminRepository) + public function __construct(IACLRuleRoleRepository $aclRoleAdminRepository, IACLRuleUserRepository $aclUserAdminRepository) { - $this->ruleRoleAdminRepository = $ruleRoleAdminRepository; - $this->ruleUserAdminRepository = $ruleUserAdminRepository; + $this->aclRoleAdminRepository = $aclRoleAdminRepository; + $this->aclUserAdminRepository = $aclUserAdminRepository; } /** @@ -92,33 +92,33 @@ public function rule(ACLValidation $request, $context, $object) if ($context == ACLValidation::GRANT_PERMISSIONS_TO_ROLE || $context == ACLValidation::REVOKE_PERMISSIONS_FROM_ROLE) { - $this->ruleRoleAdminRepository->forRole($object); + $this->aclRoleAdminRepository->forRole($object); foreach ($form["rules"] as $rule) { if ($context == ACLValidation::GRANT_PERMISSIONS_TO_ROLE) { - $data[] = $this->ruleRoleAdminRepository->grant($rule); + $data[] = $this->aclRoleAdminRepository->grant($rule); } else if ($context == ACLValidation::REVOKE_PERMISSIONS_FROM_ROLE) { - $data[] = $this->ruleRoleAdminRepository->revoke($rule); + $data[] = $this->aclRoleAdminRepository->revoke($rule); } } } else if ($context == ACLValidation::GRANT_ROLES_TO_USER || $context == ACLValidation::REVOKE_ROLES_FROM_USER) { - $this->ruleUserAdminRepository->setUser(app(AuthModelContract::class)->findOrFail($object)); + $this->aclUserAdminRepository->setUser(app(AuthModelContract::class)->findOrFail($object)); foreach ($form["rules"] as $rule) { if ($context == ACLValidation::GRANT_ROLES_TO_USER) { - $data[] = $this->ruleUserAdminRepository->grantAs($rule); + $data[] = $this->aclUserAdminRepository->grantAs($rule); } else if ($context == ACLValidation::REVOKE_ROLES_FROM_USER) { - $data[] = $this->ruleUserAdminRepository->revokeAs($rule); + $data[] = $this->aclUserAdminRepository->revokeAs($rule); } } }