1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

space categorty management

This commit is contained in:
Harvey Kandola 2017-09-19 17:58:33 +01:00
parent a86d52388e
commit 4874d23f15
19 changed files with 915 additions and 40 deletions

View file

@ -113,21 +113,21 @@ func (h *Handler) SaveAs(w http.ResponseWriter, r *http.Request) {
return
}
if !permission.HasDocumentAction(ctx, *h.Store, model.DocumentID, pm.DocumentTemplate) {
response.WriteForbiddenError(w)
return
}
// DB transaction
ctx.Transaction, err = h.Runtime.Db.Beginx()
// Duplicate document
doc, err := h.Store.Document.Get(ctx, model.DocumentID)
if err != nil {
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)
return
}
// Duplicate document
doc, err := h.Store.Document.Get(ctx, model.DocumentID)
if !permission.HasPermission(ctx, *h.Store, doc.LabelID, pm.DocumentTemplate) {
response.WriteForbiddenError(w)
return
}
// DB transaction
ctx.Transaction, err = h.Runtime.Db.Beginx()
if err != nil {
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)