Skip to content

Commit

Permalink
Merge branch 'niden-T13758-acl-default-access-level' into 4.0.x
Browse files Browse the repository at this point in the history
* niden-T13758-acl-default-access-level:
  [#13758] - Added changelog entry
  [#13758] - Added test for default action in Acl
  [#13758] - Added default action to be deny
  [4.0.x] - Added match to travis for issue branches
  [4.0.x] - Code cleanup
  Revert "Revert "[4.0.x] -""
  Revert "[4.0.x] -"
  [4.0.x] -
  [4.0.x] - PHPCS fix
  • Loading branch information
niden committed Jan 10, 2019
2 parents 5a8b7fc + eab56b3 commit 28ebca5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Changed the `Phalcon\Html\Tag::renderTitle()` parameters such as `Phalcon\Html\Tag::getTitle()` [#13706](https://github.com/phalcon/cphalcon/pull/13706)
- Changed the `Phalcon\Version::get()` to follow [semantic versioning](https://semver.org/) [#13720](https://github.com/phalcon/cphalcon/pull/13720)
- Changed the `Phalcon\Translate\Adapter\NativeArray` to accept a new parameter in the constructor `triggerError`. This will trigger an error if the key is not found [#13007](https://github.com/phalcon/cphalcon/pull/13007)
- Changed the default action of `Phalcon\Acl\Memory`to be `Acl::DENY` instead of `Acl::ALLOW` [#13758](https://github.com/phalcon/cphalcon/pull/13758)

# [4.0.0-alpha1](https://github.com/phalcon/cphalcon/releases/tag/v4.0.0-alpha1) (2018-12-25)
## Added
Expand Down
2 changes: 1 addition & 1 deletion phalcon/acl/adapter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class Adapter implements AdapterInterface, EventsAwareInterface
* Default access
* @var bool
*/
protected _defaultAccess = true;
protected _defaultAccess = false;

/**
* Access Granted
Expand Down
18 changes: 18 additions & 0 deletions tests/unit/Acl/Adapter/Memory/GetSetDefaultActionCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,22 @@ public function aclAdapterMemoryGetSetDefaultAction(UnitTester $I)
$actual = $acl->getDefaultAction();
$I->assertEquals($expected, $actual);
}

/**
* Tests Phalcon\Acl\Adapter\Memory :: getDefaultAction()/setDefaultAction()
*
* @param UnitTester $I
*
* @author Phalcon Team <team@phalconphp.com>
* @since 2018-11-13
*/
public function aclAdapterMemoryGetSetDefaultActionDefault(UnitTester $I)
{
$I->wantToTest('Acl\Adapter\Memory - getDefaultAction()/setDefaultAction() - default');
$acl = new Memory();

$expected = Acl::DENY;
$actual = $acl->getDefaultAction();
$I->assertEquals($expected, $actual);
}
}

0 comments on commit 28ebca5

Please sign in to comment.