Skip to content

Commit

Permalink
EZP-28926: Add validation for PermissionResolver::hasAccess(module, f…
Browse files Browse the repository at this point in the history
…unction) arguments (#2273)

* [WIP][6.7] Add validation for hasAccess(module, function) arguments

To avoid issues such as ezsystems/ezplatform-admin-ui#358

Todo:
- Find a way to move `eZ/Bundle/EzPublishCoreBundle/Resources/config/policies.yml` into core
  and reuse across Core and CoreBundle to get rid of the internal hard coded policy map.
- Unit tests, some failing with `Argument 'module' is invalid: 'module: test-module/ function: test-function' is wrong value`

* EZP-28926: Add validation for PermissionResolver::hasAccess(module, function) arguments

* CS fix

* Added missing empty line

* Updated specification

* Added deprecated info

* fixup! Added missing empty line

* Improved test code quality
  • Loading branch information
kmadejski authored and andrerom committed Mar 12, 2018
1 parent 6c67eca commit 18235e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Repository/PermissionResolver.php
Expand Up @@ -34,6 +34,8 @@ public function setCurrentUserReference(UserReference $userReference);
*
* Note: boolean value describes full access (true) or no access at all (false).
*
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If module or function is invalid.
*
* @param string $module The module, aka controller identifier to check permissions on
* @param string $function The function, aka the controller action to check permissions on
* @param \eZ\Publish\API\Repository\Values\User\UserReference|null $userReference User for
Expand Down
2 changes: 2 additions & 0 deletions Repository/Repository.php
Expand Up @@ -47,6 +47,8 @@ public function setCurrentUser(UserReference $user);
/**
* @deprecated since 6.6, to be removed. Use PermissionResolver::hasAccess() instead.
*
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If module or function is invalid.
*
* @param string $module The module, aka controller identifier to check permissions on
* @param string $function The function, aka the controller action to check permissions on
* @param \eZ\Publish\API\Repository\Values\User\UserReference $user
Expand Down

0 comments on commit 18235e6

Please sign in to comment.