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

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

* 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 gsw945
parent 00716d1b31
commit ee73cfb69e
19 changed files with 67 additions and 9 deletions

View File

@@ -162,6 +162,9 @@ func (c *BlogController) ManageSetting() {
bookIdentify := strings.TrimSpace(c.GetString("bookIdentify"))
documentId := 0
if c.Member.Role == conf.MemberReaderRole {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.no_permission"))
}
if blogTitle == "" {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.blog_title_empty"))
}
@@ -286,6 +289,10 @@ func (c *BlogController) ManageEdit() {
c.Prepare()
c.TplName = "blog/manage_edit.tpl"
if c.Member.Role == conf.MemberReaderRole {
c.JsonResult(6001, i18n.Tr(c.Lang, "message.no_permission"))
}
if c.Ctx.Input.IsPost() {
blogId, _ := c.GetInt("blogId", 0)