Skip to content

Commit 3318a10

Browse files
committed
cs fix (1)
1 parent d414d91 commit 3318a10

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

resources/lib/UnityPerms.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public function checkApproveUser($uid, $operated_on, $group)
2121

2222
$role = $this->SQL->getRole($uid, $group);
2323

24-
if ($this->SQL->hasPermission($role, 'unity.admin') || $this->SQL->hasPermission($role, 'unity.admin_no_grant')) {
24+
if ($this->SQL->hasPerm($role, 'unity.admin') || $this->SQL->hasPerm($role, 'unity.admin_no_grant')) {
2525
return true;
2626
}
2727

28-
if (!$this->SQL->hasPermission($role, 'unity.approve_user')) {
28+
if (!$this->SQL->hasPerm($role, 'unity.approve_user')) {
2929
return false;
3030
}
3131

@@ -46,11 +46,11 @@ public function checkDenyUser($uid, $operated_on, $group)
4646

4747
$role = $this->SQL->getRole($uid, $group);
4848

49-
if ($this->SQL->hasPermission($role, 'unity.admin') || $this->SQL->hasPermission($role, 'unity.admin_no_grant')) {
49+
if ($this->SQL->hasPerm($role, 'unity.admin') || $this->SQL->hasPerm($role, 'unity.admin_no_grant')) {
5050
return true;
5151
}
5252

53-
if (!$this->SQL->hasPermission($role, 'unity.deny_user')) {
53+
if (!$this->SQL->hasPerm($role, 'unity.deny_user')) {
5454
return false;
5555
}
5656

@@ -75,11 +75,11 @@ public function checkGrantRole($uid, $group, $role)
7575

7676
$user_role = $this->SQL->getRole($uid, $group);
7777

78-
if ($this->SQL->hasPermission($user_role, 'unity.admin') || $this->SQL->hasPermission($user_role, 'unity.admin_no_grant')) {
78+
if ($this->SQL->hasPerm($user_role, 'unity.admin') || $this->SQL->hasPerm($user_role, 'unity.admin_no_grant')) {
7979
return true;
8080
}
8181

82-
if (!$this->SQL->hasPermission($user_role, 'unity.grant_role')) {
82+
if (!$this->SQL->hasPerm($user_role, 'unity.grant_role')) {
8383
return false;
8484
}
8585

@@ -89,7 +89,7 @@ public function checkGrantRole($uid, $group, $role)
8989
return false;
9090
}
9191

92-
return true;
92+
return true;
9393
}
9494

9595
public function checkRevokeRole($uid, $group, $role)
@@ -104,11 +104,11 @@ public function checkRevokeRole($uid, $group, $role)
104104

105105
$user_role = $this->SQL->getRole($uid, $group);
106106

107-
if ($this->SQL->hasPermission($user_role, 'unity.admin') || $this->SQL->hasPermission($user_role, 'unity.admin_no_grant')) {
107+
if ($this->SQL->hasPerm($user_role, 'unity.admin') || $this->SQL->hasPerm($user_role, 'unity.admin_no_grant')) {
108108
return true;
109109
}
110110

111-
if (!$this->SQL->hasPermission($user_role, 'unity.revoke_role')) {
111+
if (!$this->SQL->hasPerm($user_role, 'unity.revoke_role')) {
112112
return false;
113113
}
114114

@@ -118,6 +118,6 @@ public function checkRevokeRole($uid, $group, $role)
118118
return false;
119119
}
120120

121-
return true;
121+
return true;
122122
}
123-
}
123+
}

resources/lib/UnitySQL.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function getRole($uid, $group)
319319
return $stmt->fetchAll()[0]['role'];
320320
}
321321

322-
public function hasPermission($role, $perm)
322+
public function hasPerm($role, $perm)
323323
{
324324
$stmt = $this->conn->prepare(
325325
"SELECT * FROM " . self::TABLE_GROUP_ROLES . " WHERE slug=:role"
@@ -356,7 +356,7 @@ public function roleAvailableInGroup($uid, $group, $role)
356356

357357
$stmt->execute();
358358
$row = $stmt->fetchAll()[0];
359-
359+
360360
$group_slug = $row['group'];
361361

362362
$stmt = $this->conn->prepare(

0 commit comments

Comments
 (0)