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

Hope to add a new feature: PermissionControl #7

Closed
pigochu opened this issue Sep 14, 2020 · 1 comment
Closed

Hope to add a new feature: PermissionControl #7

pigochu opened this issue Sep 14, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pigochu
Copy link

pigochu commented Sep 14, 2020

Orignal Yii has AccessControl that use in Controller behavior.

It's simple for us to control page permission.

I think yii-permission should be able to implement.

usage example in controller:

public function behaviors() {

    return [
       'permission' => PermissionControl::class
       'rules' => [
           'allow' => true,
           'actions' => ['index', 'view'],
           'enforce' => [
              'user' => \Yii::$app->user->identity->id, // map to $v0
              'obj' => 'data1', // map to $v1
              'dom' => 'domain1', // map to $v2 ?
              'act' => 'read', // map to $v3 ?
           ],
       ],
    ];
}

It will check current user can read domain1's data1 , then allow actions index and view.
$v0~$v5 can be alias in config for readable.

I don’t know if anyone can experiment with my wish 😍

@Dobmod
Copy link
Member

Dobmod commented Aug 21, 2024

This issue can be closed now.😀 @leeqvip

@leeqvip leeqvip closed this as completed Aug 22, 2024
@leeqvip leeqvip reopened this Aug 22, 2024
@leeqvip leeqvip closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants