|
|
|
@ -183,7 +183,6 @@ func (this *ShareController) Permits(writer http.ResponseWriter, request *http.R |
|
|
|
uuid := request.FormValue("uuid") |
|
|
|
update := request.FormValue("update") |
|
|
|
permitList := request.FormValue("permitList") |
|
|
|
//uid := request.FormValue("uid") //当前用户
|
|
|
|
|
|
|
|
if uuid == "" { |
|
|
|
panic(result.BadRequest("uuid cannot be null")) |
|
|
|
@ -197,6 +196,10 @@ func (this *ShareController) Permits(writer http.ResponseWriter, request *http.R |
|
|
|
//通过users参数进行逻辑分支处理
|
|
|
|
if update == "true" && permitList != "" { |
|
|
|
length := request.FormValue("len") |
|
|
|
user := this.checkUser(request) |
|
|
|
if share.UserUuid != user.Uuid { |
|
|
|
panic(result.Unauthorized("have no permission for editing")) |
|
|
|
} |
|
|
|
|
|
|
|
permited, err := checkFormatOfPermitList(permitList, length) |
|
|
|
if err != nil { |
|
|
|
@ -339,7 +342,13 @@ func (this *ShareController) Browse(writer http.ResponseWriter, request *http.Re |
|
|
|
rootUuid := request.FormValue("rootUuid") |
|
|
|
|
|
|
|
user := this.findUser(request) |
|
|
|
|
|
|
|
share := this.shareService.CheckShare(request, shareUuid, code, user) |
|
|
|
//by han: add permitList verification feature
|
|
|
|
if user.Uuid != share.UserUuid && share.PermitList != "" && !strings.Contains(share.PermitList, user.Uuid) { |
|
|
|
panic(result.UNAUTHORIZED) |
|
|
|
} |
|
|
|
|
|
|
|
bridges := this.bridgeDao.FindByShareUuid(share.Uuid) |
|
|
|
|
|
|
|
if puuid == MATTER_ROOT { |
|
|
|
@ -416,6 +425,12 @@ func (this *ShareController) Zip(writer http.ResponseWriter, request *http.Reque |
|
|
|
|
|
|
|
//download all things.
|
|
|
|
share := this.shareService.CheckShare(request, shareUuid, code, user) |
|
|
|
|
|
|
|
//by han: add verification for downloadAPI
|
|
|
|
if user.Uuid != share.UserUuid && share.PermitList != "" && !strings.Contains(share.PermitList, user.Uuid) { |
|
|
|
panic(result.UNAUTHORIZED) |
|
|
|
} |
|
|
|
|
|
|
|
bridges := this.bridgeDao.FindByShareUuid(share.Uuid) |
|
|
|
var matterUuids []string |
|
|
|
for _, bridge := range bridges { |
|
|
|
|