diff --git a/src/Can.php b/src/Can.php index 52c18a0..5ee0f27 100644 --- a/src/Can.php +++ b/src/Can.php @@ -252,11 +252,6 @@ public function access(?Authenticatable $user, array $options = []): Permission if ($this->isGuest($this->user)) { $permission->markIsGuest(); } - // dump([ - // '$isGuest' => $isGuest, - // '$permission' => $permission, - // '$user' => $user, - // ]); if ($permission->isGuest()) { // Deny if guest is not permitted diff --git a/src/Issuer.php b/src/Issuer.php index 789740a..6b923d4 100644 --- a/src/Issuer.php +++ b/src/Issuer.php @@ -186,19 +186,6 @@ protected function compileAbilitiesByGroup(string $group): array } } - // dump([ - // '__METHOD__' => __METHOD__, - // '$group' => $group, - // '$abilities' => $abilities, - // '$package_abilities' => $package_abilities, - // '$this->rootAccessGroups' => $this->rootAccessGroups, - // '$this->rootAbilities' => $this->rootAbilities, - // '$this->isRoot' => $this->isRoot, - // '$this->isAdmin' => $this->isAdmin, - // '$this->isManager' => $this->isManager, - // '$this->isUser' => $this->isUser, - // '$this->isGuest' => $this->isGuest, - // ]); return $abilities; } @@ -360,11 +347,6 @@ public function authorize(Authenticatable $user): array } else { $tokens = []; } - // dd([ - // '$tokens' => $tokens, - // '$this->useSanctum' => $this->useSanctum, - // '$this->hasSanctum' => $this->hasSanctum, - // ]); return $tokens; } @@ -378,9 +360,6 @@ public function sanctum(Authenticatable $user): array * @var array $config */ $config = config('playground-auth.token'); - // dump([ - // '$config' => $config, - // ]); $this->init($user); diff --git a/src/Policies/ModelPolicy.php b/src/Policies/ModelPolicy.php index 3c87b09..67e7eaf 100644 --- a/src/Policies/ModelPolicy.php +++ b/src/Policies/ModelPolicy.php @@ -51,17 +51,6 @@ public function delete( */ public function detail(Authenticatable $user, Model $model): bool|Response { - // dd([ - // '__METHOD__' => __METHOD__, - // '__FILE__' => __FILE__, - // '__LINE__' => __LINE__, - // 'static::class' => static::class, - // '$user' => $user->toArray(), - // '$this->allowRootOverride' => $this->allowRootOverride, - // '$this->package' => $this->package, - // '$this->entity' => $this->entity, - // 'config(playground-auth)' => config('playground-auth'), - // ]); return $this->verify($user, 'view'); } @@ -120,17 +109,6 @@ public function store(Authenticatable $user): bool|Response */ public function update(Authenticatable $user, Model $model): bool|Response { - // dd([ - // '__METHOD__' => __METHOD__, - // '__FILE__' => __FILE__, - // '__LINE__' => __LINE__, - // 'static::class' => static::class, - // '$user' => $user->toArray(), - // '$this->allowRootOverride' => $this->allowRootOverride, - // '$this->package' => $this->package, - // '$this->entity' => $this->entity, - // 'config(playground-auth)' => config('playground-auth'), - // ]); // Models must be unlocked to allow updating. // NOTE: This lock check is bypassed by a root user. if ($model->getAttribute('locked')) { diff --git a/src/Policies/PolicyTrait.php b/src/Policies/PolicyTrait.php index 60a8443..df927f4 100644 --- a/src/Policies/PolicyTrait.php +++ b/src/Policies/PolicyTrait.php @@ -63,13 +63,6 @@ public function setToken(PersonalAccessToken $token = null): self public function verify(Authenticatable $user, string $ability): bool|Response { $verify = config('playground-auth.verify'); - // dump([ - // '__METHOD__' => __METHOD__, - // '$verify' => $verify, - // '$ability' => $ability, - // '$user' => $user, - // 'test' => config('app.debug') && config('playground-auth.debug'), - // ]); if (in_array($verify, ['policy', 'privileges', 'sanctum'])) { return $this->hasPrivilege($user, $this->privilege($ability)); } elseif ($verify === 'roles') { diff --git a/src/Policies/RoleTrait.php b/src/Policies/RoleTrait.php index 83f9bbf..aa49aa1 100644 --- a/src/Policies/RoleTrait.php +++ b/src/Policies/RoleTrait.php @@ -145,15 +145,6 @@ public function hasRole(Authenticatable $user, string $ability): bool|Response } } - // dump([ - // '__METHOD__' => __METHOD__, - // '$user' => $user, - // 'userRole' => config('playground-auth.userRole'), - // 'userRoles' => config('playground-auth.userRoles'), - // 'hasRole' => config('playground-auth.hasRole') && method_exists($user, 'hasRole'), - // '$ability' => $ability, - // '$roles' => $roles, - // ]); return Response::denyWithStatus(401, __('playground-auth::auth.unauthorized')); } }