创建部门的同时设置其权限
This commit is contained in:
@@ -257,20 +257,7 @@ class CreateCompanyController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置部门权限
|
||||
*
|
||||
* @param array $params
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function setDepartmentPrivileges(array $params): void
|
||||
{
|
||||
|
||||
$params = ArrHelper::getValue('companyId=id', $params);
|
||||
$accountController = new \app\api\controller\AccountController();
|
||||
$accountController->setPrivileges(['id' => $params['companyId']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建新项目
|
||||
@@ -283,12 +270,8 @@ class CreateCompanyController extends BaseController
|
||||
$params = $this->request->only(['name', 'status', 'username', 'account', 'password', 'phone', 'memo']);
|
||||
$params = $this->dataValidate($params)->creatS2About($params);
|
||||
|
||||
// 设置部门权限
|
||||
$this->setDepartmentPrivileges($params);
|
||||
|
||||
Db::startTrans();
|
||||
|
||||
|
||||
$this->checkCompanyNameOrAccountOrPhoneExists(ArrHelper::getValue('name,account,phone', $params));
|
||||
$this->createCkbAbout($params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user