Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acl default access #12573

Closed
Jurigag opened this issue Jan 25, 2017 · 6 comments
Closed

Acl default access #12573

Jurigag opened this issue Jan 25, 2017 · 6 comments
Labels
bug A bug report status: medium Medium
Milestone

Comments

@Jurigag
Copy link
Contributor

Jurigag commented Jan 25, 2017

Expected and Actual Behavior

Currently when using setDefaultAccess in Phalcon\Acl\Adapter\Memory and then adding roles it's adding such an access:

let this->_access[roleName . "!*!*"] = this->_defaultAccess;

Since the memory adapter is just stopping when hit any key, it will first hit this key and ignore any other allow rules we will set. I think we can safely remove this line https://github.com/phalcon/cphalcon/blob/master/phalcon/acl/adapter/memory.zep#L210 and let this line https://github.com/phalcon/cphalcon/blob/master/phalcon/acl/adapter/memory.zep#L682 handle when no access was found. Right now things doesn't work as expected i think. Or maybe we should change allow/deny methods to always at add beginning of array, not at the end.

I was changing one time other issue, maybe it created this, i don't know. Will create PR with fix i guess.

Provide minimal script to reproduce the issue

$acl = new Memory();
$acl->setDefaultAccess(\Phalcon\Acl::DENY);
$acl->addResource('Test', ['one', 'two']);
$acl->addRole('ROLE1');
$acl->allow('ROLE1', 'Test', 'one');
$acl->isAllowed('ROLE1', 'Test', 'one'); // will return false

Details

  • Phalcon version: 3.1.x
  • PHP Version: 7.0.13
  • Operating System: Unbuntu 14.04
  • Installation type: Compiling from source
  • Zephir version: 0.9.5a-dev-bad1ef6b4d
  • Server: cli
Jurigag added a commit to Jurigag/cphalcon that referenced this issue Jan 25, 2017
Jurigag added a commit to Jurigag/cphalcon that referenced this issue Jan 25, 2017
@Jurigag Jurigag mentioned this issue Jan 25, 2017
3 tasks
@sergeyklay sergeyklay added this to the 3.0.4 milestone Jan 25, 2017
@dschissler

This comment was marked as abuse.

@Jurigag
Copy link
Contributor Author

Jurigag commented Jan 26, 2017

What you mean? Could you provide some example?

@dschissler

This comment was marked as abuse.

@Jurigag
Copy link
Contributor Author

Jurigag commented Jan 26, 2017

But i don't really see a point of doing this. Any example of code what you mean? Or you mean add way to get just only this function?

@dschissler

This comment was marked as abuse.

@Jurigag
Copy link
Contributor Author

Jurigag commented Jan 26, 2017

But i still don't know what you exactly mean.

sergeyklay added a commit that referenced this issue Feb 25, 2017
* Regenerated build (PHP7)

* Regenerated build (PHP5)

* Regenerated build (PHP5)

* Regenerated build (PHP7)

* Using latest Zephir [ci skip]

* Bump dev version

* Added a number (0) to be a label in a form field. Null, empty string or empty array will keep invalidating a label and using the value instead.

* Update CONTRIBUTING.md [ci skip]

* Include cipher aliases for \Phalcon\Crypt

The older version of Phalcon used aliases for cipher and now they are not available. They are easy to use and migration will be easier if they persist.

* Test Alias cipher for \Phalcon\Crypt

* Update Changelog

* Change test in changelog

* Allow other except fields than unique fields

* Added backers file

* Update tests CHANGELOG.md [ci skip]

Add TEST_MC_WEIGHT to export list

* Fixed #12567 [ci skip]

* Cleaned .gitignorei [ci skip]

* Update Phalcon\Mvc\Model return ResultsetInterface (#12574)

* Update Phalcon\Mvc\Model return ResultsetInterface

ResultsetInterface is not imported and causes problems when generating Stubs for IDE. It is generating @return type of Phalcon\Mvc\ResultsetInterface and not Phalcon\Mvc\Model\ResultsetInterface

I think it should be imported in order to easily find correct class

* Update CHANGELOG.md

* Updated backers file

* Fixes #12573

* Updated backers file

* Update BACKERS.md with known links

* Added mctekk and abits logos

* Removing the images to ensure that they are refreshed with the next commit

* Re-added the images for backers

* Added pdffiller in the backers file

* Added links to the BACKERS.md

* Updated backers file

* Removing the images to ensure that they are refreshed with the next commit

* Re-added the images for backers

* Added links to the BACKERS.md

* Updated backers file

* Updated backers file

* Updated backers file

* Updated backers file

* Bump version

* Tune up Travis build

* Fixed ModelsManager tests

* Tune up PHP_CodeSniffer

* Tune up PHP_CodeSniffer

* Tune up the tests

* Updated CHANGELOG.md [ci skip]

* Cleaned Gettext::query

* Fixed Phalcon\Validation\Message\Group::offsetUnset

* Allow role and resource object in isAllowed

* Updated backers file

* Updated backers file

* Updated backers file

* Removing the images to ensure that they are refreshed with the next commit

* Re-added the images for backers

* Added links to the BACKERS.md

* Updated Copyright [ci skip]

* Updated dependencies

* Regenerated build (PHP7)

* Regenerated build (PHP5)

* Using latest Zephir

* Updated CHANGELOG.md [ci skip]

* Restarted Travis build

* Regenerated build [ci skip]

* Regenerating build for php5 [ci skip]

* Cleaned Phalcon\Annotations\AdapterInterface

* Cleaned the Appveyor Build

* Added Phalcon\Validation for Phalcon\Mvc\Collection

* install file refactoring, custom phpize & php-config paths allowed

* install BINs fix

* Rosolved conflicts [ci skip]

* Removed unused variables

* Amended Uniqueness Validator test

* Port Uniquenss Validator changes from 3.0.x

* Regenerated build (PHP7) [ci skip]

* Regenerated build (PHP5) [ci skip]

* Using latest Zephir [ci skip]
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

4 participants