Skip to content

access control params for biz rules #3

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

Merged
merged 1 commit into from
Apr 24, 2015
Merged

Conversation

igor-khripun
Copy link

No description provided.

@@ -22,7 +27,8 @@ public function beforeAction($action)
{
$actionId = $action->getUniqueId();
$user = Yii::$app->getUser();
if ($user->can('/' . $actionId)) {
$params = isset($this->params[$action->id]) ? $this->params[$action->id] : [];
if ($user->can('/' . $actionId, $params)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about second can check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first can checks action (module/controller/action), the second can checks controller (module/controller/) and module (module/). It's quite enaugh to pass params in first can only, because biz rules generally are not used for controller and module routes.

disem pushed a commit that referenced this pull request Apr 24, 2015
access control params for biz rules
@disem disem merged commit 2213b1e into yii2mod:master Apr 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants