|
@@ 289-300 (lines=12) @@
|
| 286 |
|
self::assertInstanceOf(Limitation::class, $limitation); |
| 287 |
|
|
| 288 |
|
if ($policy->module == 'content' && $policy->function == 'read') { |
| 289 |
|
switch ($limitation->getIdentifier()) { |
| 290 |
|
case Limitation::CONTENTTYPE: |
| 291 |
|
self::assertEquals($limitation1->limitationValues, $limitation->limitationValues); |
| 292 |
|
break; |
| 293 |
|
|
| 294 |
|
case Limitation::SECTION: |
| 295 |
|
self::assertEquals($limitation2->limitationValues, $limitation->limitationValues); |
| 296 |
|
break; |
| 297 |
|
|
| 298 |
|
default: |
| 299 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 300 |
|
} |
| 301 |
|
} elseif ($policy->module == 'content' && $policy->function == 'edit') { |
| 302 |
|
switch ($limitation->getIdentifier()) { |
| 303 |
|
case Limitation::OWNER: |
|
@@ 302-313 (lines=12) @@
|
| 299 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 300 |
|
} |
| 301 |
|
} elseif ($policy->module == 'content' && $policy->function == 'edit') { |
| 302 |
|
switch ($limitation->getIdentifier()) { |
| 303 |
|
case Limitation::OWNER: |
| 304 |
|
self::assertEquals($limitation3->limitationValues, $limitation->limitationValues); |
| 305 |
|
break; |
| 306 |
|
|
| 307 |
|
case Limitation::USERGROUP: |
| 308 |
|
self::assertEquals($limitation4->limitationValues, $limitation->limitationValues); |
| 309 |
|
break; |
| 310 |
|
|
| 311 |
|
default: |
| 312 |
|
self::fail('Created role contains limitations not defined with create struct'); |
| 313 |
|
} |
| 314 |
|
} else { |
| 315 |
|
self::fail('Created role contains policy not defined with create struct'); |
| 316 |
|
} |