|
@@ 272-283 (lines=12) @@
|
| 269 |
|
self::assertInstanceOf(Limitation::class, $limitation); |
| 270 |
|
|
| 271 |
|
if ($policy->module == 'content' && $policy->function == 'read') { |
| 272 |
|
switch ($limitation->getIdentifier()) { |
| 273 |
|
case Limitation::CONTENTTYPE: |
| 274 |
|
self::assertEquals($limitation1->limitationValues, $limitation->limitationValues); |
| 275 |
|
break; |
| 276 |
|
|
| 277 |
|
case Limitation::SECTION: |
| 278 |
|
self::assertEquals($limitation2->limitationValues, $limitation->limitationValues); |
| 279 |
|
break; |
| 280 |
|
|
| 281 |
|
default: |
| 282 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 283 |
|
} |
| 284 |
|
} elseif ($policy->module == 'content' && $policy->function == 'edit') { |
| 285 |
|
switch ($limitation->getIdentifier()) { |
| 286 |
|
case Limitation::OWNER: |
|
@@ 285-296 (lines=12) @@
|
| 282 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 283 |
|
} |
| 284 |
|
} elseif ($policy->module == 'content' && $policy->function == 'edit') { |
| 285 |
|
switch ($limitation->getIdentifier()) { |
| 286 |
|
case Limitation::OWNER: |
| 287 |
|
self::assertEquals($limitation3->limitationValues, $limitation->limitationValues); |
| 288 |
|
break; |
| 289 |
|
|
| 290 |
|
case Limitation::USERGROUP: |
| 291 |
|
self::assertEquals($limitation4->limitationValues, $limitation->limitationValues); |
| 292 |
|
break; |
| 293 |
|
|
| 294 |
|
default: |
| 295 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 296 |
|
} |
| 297 |
|
} else { |
| 298 |
|
self::fail('Created role contains policy not defined with create struct'); |
| 299 |
|
} |