如何在yii2 admin中更新函数ownpost
我正在使用yii2管理。所有角色和权限都添加到浏览器中。(/localhost/yiiproject/site/admin/) 现在我的问题是我不知道如何添加如何在yii2 admin中更新函数ownpost,yii2,rbac,Yii2,Rbac,我正在使用yii2管理。所有角色和权限都添加到浏览器中。(/localhost/yiiproject/site/admin/) 现在我的问题是我不知道如何添加updateOwnPost。我已经读过了。 我没有RBAController 这是我的密码 $auth = Yii::$app->authManager; // add the rule $rule = new \app\rbac\AuthorRule; $auth->add($rule); // add the "upda
updateOwnPost
。我已经读过了。
我没有RBAController
这是我的密码
$auth = Yii::$app->authManager;
// add the rule
$rule = new \app\rbac\AuthorRule;
$auth->add($rule);
// add the "updateOwnPost" permission and associate the rule with it.
$updateOwnPost = $auth->createPermission('updateOwnPost');
$updateOwnPost->description = 'Update own post';
$updateOwnPost->ruleName = $rule->name;
$auth->add($updateOwnPost);
// "updateOwnPost" will be used from "updatePost"
$auth->addChild($updateOwnPost, $updatePost);
// allow "author" to update their own posts
$auth->addChild($author, $updateOwnPost);
有updateOwnPost的例子吗