From 30cdcce948478ddf7374b242fcdd2d58b1066494 Mon Sep 17 00:00:00 2001 From: xunjianxiang Date: Thu, 14 Sep 2017 19:33:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=9E=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=BA=93=E6=88=90=E5=91=98=E5=8F=AF=E7=9C=8B=E5=88=B0=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/document.go | 7 ++----- views/document/default_read.tpl | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/controllers/document.go b/controllers/document.go index e4728bc3..48023380 100644 --- a/controllers/document.go +++ b/controllers/document.go @@ -42,12 +42,9 @@ func isReadable(identify, token string, c *DocumentController) *models.BookResul beego.Error(err) 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 diff --git a/views/document/default_read.tpl b/views/document/default_read.tpl index 16544328..4dfc1912 100644 --- a/views/document/default_read.tpl +++ b/views/document/default_read.tpl @@ -47,9 +47,11 @@