/** * 删除用户组 * * @param array $ids 用户组的id * @return boolean true|false * @access public */ public function detele($ids) { if (!is_array($ids)) { return false; } foreach ($ids as $key => $value) { if (!$this->acl->checkGroupLevelPermission($value, Acl::GROUP_LEVEL_TYPE_GROUP)) { return $this->setErrorMsg(Lang::get('common.account_level_deny')); } } if ($this->groupModel->deleteGroup($ids) !== false) { $result = with(new AccessModel())->deleteInfo(['type' => AccessModel::AP_GROUP, 'role_id' => $ids]); return true; } return $this->setErrorMsg(Lang::get('common.action_error')); }
/** * * @param int $id * @return bool $success */ public function deleteGroup($id) { $success = $this->modelRepository->deleteGroup($id); return $success; }