1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Tweaks to backup process permissions

This commit is contained in:
sauls8t 2018-10-20 12:41:26 +01:00
parent db04057d9e
commit cee71cb313
7 changed files with 670 additions and 680 deletions

View file

@ -158,13 +158,6 @@ func (h *Handler) Restore(w http.ResponseWriter, r *http.Request) {
return
}
createUsers, err := strconv.ParseBool(request.Query(r, "users"))
if err != nil {
h.Runtime.Log.Info("Restore invoked without 'users' parameter")
response.WriteMissingDataError(w, method, "users=false/true missing")
return
}
filedata, fileheader, err := r.FormFile("restore-file")
if err != nil {
response.WriteMissingDataError(w, method, "restore-file")
@ -191,7 +184,7 @@ func (h *Handler) Restore(w http.ResponseWriter, r *http.Request) {
}
// Prepare context and start restore process.
spec := m.ImportSpec{OverwriteOrg: overwriteOrg, CreateUsers: createUsers, Org: org}
spec := m.ImportSpec{OverwriteOrg: overwriteOrg, Org: org}
rh := restoreHandler{Runtime: h.Runtime, Store: h.Store, Context: ctx, Spec: spec}
// Run the restore process.

View file

@ -101,7 +101,7 @@ func (r *restoreHandler) PerformRestore(b []byte, l int64) (err error) {
r.Spec.GlobalBackup = false
}
// Process might require reassignment of ID's so prepare map.
// Process might require reassignment of ID values.
r.MapOrgID = make(map[string]string)
r.MapUserID = make(map[string]string)

View file

@ -40,7 +40,7 @@ func main() {
rt.Product.Major = "1"
rt.Product.Minor = "72"
rt.Product.Patch = "0"
rt.Product.Revision = 181007125514
rt.Product.Revision = 181020074716
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
rt.Product.Edition = "Community"
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)

File diff suppressed because one or more lines are too long

View file

@ -145,7 +145,7 @@ export default Service.extend({
// Run backup.
backup(spec) {
return new EmberPromise((resolve, reject) => {
if (!this.get('sessionService.isGlobalAdmin') || !this.get('sessionService.isAdmin')) {
if (!this.get('sessionService.isGlobalAdmin') && !this.get('sessionService.isAdmin')) {
reject();
}
@ -196,7 +196,7 @@ export default Service.extend({
data.set('restore-file', file);
return new EmberPromise((resolve, reject) => {
if (!this.get('sessionService.isGlobalAdmin') || !this.get('sessionService.isAdmin')) {
if (!this.get('sessionService.isGlobalAdmin') && !this.get('sessionService.isAdmin')) {
reject();
}

View file

@ -67,9 +67,6 @@ type ImportSpec struct {
// Overwrite current organization settings.
OverwriteOrg bool `json:"overwriteOrg"`
// Recreate users.
CreateUsers bool `json:"createUsers"`
// As found in backup file.
Manifest Manifest

View file

@ -73,7 +73,7 @@ type DocumentMetaViewer struct {
// DocumentMetaEditor contains the "edit" metatdata content.
type DocumentMetaEditor struct {
PageID string `json:"pageId"`
SectionID string `json:"pageId"`
UserID string `json:"userId"`
Action string `json:"action"`
Created time.Time `json:"created"`