|
@@ 308-321 (lines=14) @@
|
| 305 |
|
$limitation = $permissionSet['limitation']; |
| 306 |
|
$identifier = $limitation->getIdentifier(); |
| 307 |
|
|
| 308 |
|
if (isset($queryLimitationMap[$identifier])) { |
| 309 |
|
$value = reset($queryLimitationMap[$identifier]->limitationValues); |
| 310 |
|
$type = $this->limitationService->getLimitationType($identifier); |
| 311 |
|
|
| 312 |
|
// Try with next role permission set |
| 313 |
|
if (!$type->evaluateSingle($limitation, $value)) { |
| 314 |
|
continue; |
| 315 |
|
} |
| 316 |
|
} else { |
| 317 |
|
// todo How to decide if this is at all relevant for module/function? |
| 318 |
|
// ACCESS_ABSTAIN is returned by evaluate(). |
| 319 |
|
// Maybe it could be modelled on the permission map instead? |
| 320 |
|
$roleLimitations[] = $limitation; |
| 321 |
|
} |
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
$policyLimitationSet = []; |
|
@@ 348-362 (lines=15) @@
|
| 345 |
|
foreach ($limitations as $limitation) { |
| 346 |
|
$identifier = $limitation->getIdentifier(); |
| 347 |
|
|
| 348 |
|
if (isset($queryLimitationMap[$identifier])) { |
| 349 |
|
$value = reset($queryLimitationMap[$identifier]->limitationValues); |
| 350 |
|
$type = $this->limitationService->getLimitationType($identifier); |
| 351 |
|
|
| 352 |
|
if ($type->evaluateSingle($limitation, $value)) { |
| 353 |
|
// Continue evaluating |
| 354 |
|
continue; |
| 355 |
|
} else { |
| 356 |
|
// Break to next policy, all limitations must either pass or record |
| 357 |
|
break 2; |
| 358 |
|
} |
| 359 |
|
} else { |
| 360 |
|
// Record limitation for return |
| 361 |
|
$policyLimitations[] = $limitation; |
| 362 |
|
} |
| 363 |
|
} |
| 364 |
|
|
| 365 |
|
$policiesPass = true; |