mirror of https://github.com/mindoc-org/mindoc.git
修改非文档库成员可看到返回编辑按钮的 bug
parent
3899b61d2e
commit
30cdcce948
|
@ -42,12 +42,9 @@ func isReadable(identify, token string, c *DocumentController) *models.BookResul
|
||||||
beego.Error(err)
|
beego.Error(err)
|
||||||
c.Abort("500")
|
c.Abort("500")
|
||||||
}
|
}
|
||||||
if c.Member != nil && c.Member.IsAdministrator() {
|
|
||||||
bookResult := book.ToBookResult()
|
|
||||||
return bookResult
|
|
||||||
}
|
|
||||||
//如果文档是私有的
|
//如果文档是私有的
|
||||||
if book.PrivatelyOwned == 1 {
|
if book.PrivatelyOwned == 1 && !c.Member.IsAdministrator() {
|
||||||
|
|
||||||
is_ok := false
|
is_ok := false
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,11 @@
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dLabel">
|
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dLabel">
|
||||||
{{if gt .Member.MemberId 0}}
|
{{if gt .Member.MemberId 0}}
|
||||||
|
{{if gt .Model.RelationshipId 0}}
|
||||||
{{if eq .Model.RoleId 0 1 2}}
|
{{if eq .Model.RoleId 0 1 2}}
|
||||||
<li><a href="{{urlfor "DocumentController.Edit" ":key" .Model.Identify ":id" ""}}">返回编辑</a> </li>
|
<li><a href="{{urlfor "DocumentController.Edit" ":key" .Model.Identify ":id" ""}}">返回编辑</a> </li>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
<li><a href="{{urlfor "BookController.Index"}}">我的项目</a> </li>
|
<li><a href="{{urlfor "BookController.Index"}}">我的项目</a> </li>
|
||||||
<li role="presentation" class="divider"></li>
|
<li role="presentation" class="divider"></li>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue