Skip to content

Commit

Permalink
search fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
s3b4stian committed Dec 6, 2023
1 parent 0301f1f commit 6f0137b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/Linna/Authorization/PermissionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function can(Permission $permission): bool
*/
public function canById(null|int|string $permissionId): bool
{
if (isset($this->permission[$permissionId])) {
return true;
}
//if (isset($this->permission[$permissionId])) {
// return true;
//}

if (\in_array($permissionId, \array_column($this->permission, 'id'), true)) {
return true;
Expand All @@ -66,9 +66,9 @@ public function canById(null|int|string $permissionId): bool
*/
public function canByName(string $permissionName): bool
{
if (isset($this->permission[$permissionName])) {
return true;
}
//if (isset($this->permission[$permissionName])) {
// return true;
//}

if (\in_array($permissionName, \array_column($this->permission, 'name'), true)) {
return true;
Expand Down
12 changes: 6 additions & 6 deletions src/Linna/Authorization/RoleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function hasRole(Role $role): bool
*/
public function hasRoleById(null|int|string $roleId): bool
{
if (isset($this->role[$roleId])) {
return true;
}
//if (isset($this->role[$roleId])) {
// return true;
//}

if (\in_array($roleId, \array_column($this->role, 'id'), true)) {
return true;
Expand All @@ -63,9 +63,9 @@ public function hasRoleById(null|int|string $roleId): bool
*/
public function hasRoleByName(string $roleName): bool
{
if (isset($this->role[$roleName])) {
return true;
}
//if (isset($this->role[$roleName])) {
// return true;
//}

if (\in_array($roleName, \array_column($this->role, 'name'), true)) {
return true;
Expand Down
12 changes: 6 additions & 6 deletions src/Linna/Authorization/UserTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function hasUser(User $user): bool
*/
public function hasUserById(null|int|string $userId): bool
{
if (isset($this->user[$userId])) {
return true;
}
//if (isset($this->user[$userId])) {
// return true;
//}

if (\in_array($userId, \array_column($this->user, 'id'), true)) {
return true;
Expand All @@ -63,9 +63,9 @@ public function hasUserById(null|int|string $userId): bool
*/
public function hasUserByName(string $userName): bool
{
if (isset($this->user[$userName])) {
return true;
}
//if (isset($this->user[$userName])) {
// return true;
//}

if (\in_array($userName, \array_column($this->user, 'name'), true)) {
return true;
Expand Down

0 comments on commit 6f0137b

Please sign in to comment.