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

Reduce cloned space permissions copy

Removed unnecessary results from SQL.
This commit is contained in:
McMatts 2018-09-10 17:40:42 +01:00
parent 9ee9526a47
commit 0847a82fc9
3 changed files with 682 additions and 677 deletions

View file

@ -155,15 +155,15 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
return
}
spCloneRoles, err := h.Store.Permission.GetSpacePermissions(ctx, model.CloneID)
if err != nil {
ctx.Transaction.Rollback()
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)
return
}
if model.CopyPermission {
spCloneRoles, err := h.Store.Permission.GetSpacePermissions(ctx, model.CloneID)
if err != nil {
ctx.Transaction.Rollback()
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)
return
}
for _, r := range spCloneRoles {
r.RefID = sp.RefID