Changeset 952 for trunk/Modules/User
- Timestamp:
- Aug 9, 2023, 7:36:56 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UserModel.php
r934 r952 302 302 303 303 function CheckGroupPermission(string $GroupId, string $OperationId): bool 304 { 304 { 305 305 $PermissionExists = false; 306 306 // First try to check cache group-group relation … … 326 326 { 327 327 if ($DbRow['AssignedGroup'] != '') 328 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true; 328 { 329 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true; 330 } 329 331 } 330 332 } … … 383 385 384 386 if ($PermissionExists) 385 { 386 if ($this->User ['Id'] == null) $UserCondition = '(`User` IS NULL)';387 { 388 if ($this->User == null or $this->User['Id'] == null) $UserCondition = '(`User` IS NULL)'; 387 389 else $UserCondition = '(`User`="'.$this->User['Id'].'")'; 388 390 // Check user-operation relation … … 390 392 if ($DbResult->num_rows > 0) return true; 391 393 394 392 395 // Check user-group relation 393 $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', $UserCondition);396 $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', '(`AssignedGroup` IS NOT NULL) AND '.$UserCondition); 394 397 while ($DbRow = $DbResult->fetch_array()) 395 398 { 396 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;399 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true; 397 400 } 398 401 return false;
Note:
See TracChangeset
for help on using the changeset viewer.