Commit b47d1836 authored by rlgy's avatar rlgy

update

parent 68332f2f
......@@ -56,6 +56,7 @@ class AuthController extends BaseController
* 添加“角色”
* 注意:角色表的“rule_name”字段必须为“NULL”,不然会出错。
* 详情见“yii\rbac\BaseManager”的203行if($item->ruleName === null){return true;}
* @throws \Exception|\Throwable
* ---------------------------------------
*/
public function actionAdd()
......@@ -76,8 +77,8 @@ class AuthController extends BaseController
$role->description = $data['description'];
if (Yii::$app->authManager->add($role)) {
$auth = Yii::$app->authManager;
$administrator = $auth->getRole();
// Yii::$app->authManager->addChild();
$administrator = $auth->getRole('administrator');
$auth->addChild($administrator, $role);
$this->success('添加成功!', $this->getForward());
}
$this->error('添加失败!');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment