实现项目和文档锁定功能

This commit is contained in:
Minho
2018-04-10 09:21:43 +08:00
parent 92d9bc202a
commit 93fb029893
2 changed files with 5 additions and 4 deletions

View File

@@ -121,6 +121,7 @@ func (c *BookController) Setting() {
//保存项目信息
func (c *BookController) SaveBook() {
c.Prepare()
bookResult, err := c.IsPermission()
if err != nil {

View File

@@ -1252,8 +1252,8 @@ func (c *DocumentController) Lock() {
}
} else {
bookResult, err := models.NewBookResult().FindByIdentify(identify, c.Member.MemberId)
if err != nil || bookResult.RoleId == conf.BookObserver {
//只有创始人和管理员才能锁定文档
if err != nil || (bookResult.RoleId != conf.BookAdmin && bookResult.RoleId != conf.BookFounder) {
beego.Error("FindByIdentify => ", err)
c.JsonResult(6002, "项目不存在或权限不足")
}
@@ -1295,8 +1295,8 @@ func (c *DocumentController) UnLock() {
}
} else {
bookResult, err := models.NewBookResult().FindByIdentify(identify, c.Member.MemberId)
if err != nil || bookResult.RoleId == conf.BookObserver {
//只有创始人或管理员才能解锁文档
if err != nil || (bookResult.RoleId != conf.BookAdmin && bookResult.RoleId != conf.BookFounder) {
beego.Error("FindByIdentify => ", err)
c.JsonResult(6002, "项目不存在或权限不足")
}