添加只读用户角色,不能创建、编辑,只能被设置为观察者 (#992)
Some checks failed
Go / ${{ matrix.config.name }} (map[artifact:linux name:Ubuntu Latest GCC os:ubuntu-latest]) (push) Has been cancelled
Go / ${{ matrix.config.name }} (map[artifact:windows name:Windows Latest MSVC os:windows-latest]) (push) Has been cancelled

* 添加只读用户角色,不能创建、编辑,只能被设置为观察者

* Update markdown.preview.css

toc隐藏的时候,article宽度为100%

* Update cherry-markdown.css

cherry样式,隐藏toc时宽度100%

* 发布pdf时候的默认发布者(项目填写了公司名称以公司名称为准)

* 验证只读用户权限
This commit is contained in:
Rendtime
2024-12-27 15:26:03 +08:00
committed by GitHub
parent 7f25bc7533
commit 886a412a70
19 changed files with 67 additions and 9 deletions

View File

@@ -466,6 +466,9 @@ func (c *BookController) Create() {
editor := c.GetString("editor")
itemId, _ := c.GetInt("itemId")
if c.Member.Role == conf.MemberReaderRole {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.no_permission"))
}
if bookName == "" {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.project_name_empty"))
}
@@ -566,7 +569,9 @@ func (c *BookController) Copy() {
if _, err := c.IsPermission(); err != nil {
c.JsonResult(500, err.Error())
}
if c.Member.Role == conf.MemberReaderRole {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.no_permission"))
}
identify := strings.TrimSpace(c.GetString("identify", ""))
if identify == "" {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.param_error"))
@@ -587,7 +592,9 @@ func (c *BookController) Copy() {
// 导入zip压缩包或docx
func (c *BookController) Import() {
if c.Member.Role == conf.MemberReaderRole {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.no_permission"))
}
file, moreFile, err := c.GetFile("import-file")
if err == http.ErrMissingFile {
c.JsonResult(6003, "没有发现需要上传的文件")