-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
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 😍
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed