Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 17 deletions.
10 changes: 4 additions & 6 deletions src/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,15 @@ public function setRule($operation, $type, $roles = null, $resources = null,
}

if (isset($rules['allPrivileges']['type']) &&
$type === $rules['allPrivileges']['type'])
{
$type === $rules['allPrivileges']['type']
) {
unset($rules['allPrivileges']);
}
} else {
foreach ($privileges as $privilege) {
if (isset($rules['byPrivilegeId'][$privilege]) &&
$type === $rules['byPrivilegeId'][$privilege]['type'])
{
$type === $rules['byPrivilegeId'][$privilege]['type']
) {
unset($rules['byPrivilegeId'][$privilege]);
}
}
Expand Down Expand Up @@ -756,7 +756,6 @@ public function isAllowed($role = null, $resource = null, $privilege = null)

// try next Resource
$resource = $this->resources[$resource->getResourceId()]['parent'];

} while (true); // loop terminates at 'allResources' pseudo-parent
} else {
$this->isAllowedPrivilege = $privilege;
Expand All @@ -779,7 +778,6 @@ public function isAllowed($role = null, $resource = null, $privilege = null)

// try next Resource
$resource = $this->resources[$resource->getResourceId()]['parent'];

} while (true); // loop terminates at 'allResources' pseudo-parent
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Assertion/AssertionAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class AssertionAggregate implements AssertionInterface
{

const MODE_ALL = 'all';

const MODE_AT_LEAST_ONE = 'at_least_one';
Expand Down Expand Up @@ -134,7 +133,6 @@ public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $
}

foreach ($this->assertions as $assertion) {

// jit assertion mloading
if (! $assertion instanceof AssertionInterface) {
if (class_exists($assertion)) {
Expand Down
1 change: 0 additions & 1 deletion src/Assertion/AssertionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class AssertionManager extends AbstractPluginManager
{

protected $sharedByDefault = true;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
namespace Zend\Permissions\Acl\Exception;

interface ExceptionInterface
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@

class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{}
{
}
1 change: 0 additions & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
class RuntimeException extends \RuntimeException implements
ExceptionInterface
{

}
3 changes: 0 additions & 3 deletions test/AclTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,6 @@ public function testCMSExample()
$this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'publish'));
$this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'edit'));
$this->assertTrue($this->_acl->isAllowed('marketing', 'latest'));

}

/**
Expand Down Expand Up @@ -1137,7 +1136,6 @@ public function testAclAssertionsGetProperRoleWhenInheritenceIsUsed()
$this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'));

$this->assertEquals('publisher', $assertion->lastAssertRole->getRoleId());

}

/**
Expand Down Expand Up @@ -1167,7 +1165,6 @@ public function testAclAssertionsGetOriginalIsAllowedObjects()
// check to see if the last assertion has the proper objects
$this->assertInstanceOf('ZendTest\Permissions\Acl\TestAsset\UseCase1\User', $assertion->lastAssertRole, 'Assertion did not receive proper role object');
$this->assertInstanceOf('ZendTest\Permissions\Acl\TestAsset\UseCase1\BlogPost', $assertion->lastAssertResource, 'Assertion did not receive proper resource object');

}

/**
Expand Down
1 change: 0 additions & 1 deletion test/Assertion/AssertionAggregateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class AssertionAggregateTest extends \PHPUnit_Framework_TestCase
{

protected $assertionAggregate;

public function setUp()
Expand Down
1 change: 0 additions & 1 deletion test/Assertion/AssertionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class AssertionManagerTest extends \PHPUnit_Framework_TestCase
{

protected $manager;

public function setUp()
Expand Down

0 comments on commit f6f2e50

Please sign in to comment.