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:
parent
db04057d9e
commit
cee71cb313
7 changed files with 670 additions and 680 deletions
|
@ -158,13 +158,6 @@ func (h *Handler) Restore(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
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")
|
filedata, fileheader, err := r.FormFile("restore-file")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.WriteMissingDataError(w, method, "restore-file")
|
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.
|
// 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}
|
rh := restoreHandler{Runtime: h.Runtime, Store: h.Store, Context: ctx, Spec: spec}
|
||||||
|
|
||||||
// Run the restore process.
|
// Run the restore process.
|
||||||
|
|
|
@ -101,7 +101,7 @@ func (r *restoreHandler) PerformRestore(b []byte, l int64) (err error) {
|
||||||
r.Spec.GlobalBackup = false
|
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.MapOrgID = make(map[string]string)
|
||||||
r.MapUserID = make(map[string]string)
|
r.MapUserID = make(map[string]string)
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ func main() {
|
||||||
rt.Product.Major = "1"
|
rt.Product.Major = "1"
|
||||||
rt.Product.Minor = "72"
|
rt.Product.Minor = "72"
|
||||||
rt.Product.Patch = "0"
|
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.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
||||||
rt.Product.Edition = "Community"
|
rt.Product.Edition = "Community"
|
||||||
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
||||||
|
|
1328
embed/bindata.go
1328
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -145,7 +145,7 @@ export default Service.extend({
|
||||||
// Run backup.
|
// Run backup.
|
||||||
backup(spec) {
|
backup(spec) {
|
||||||
return new EmberPromise((resolve, reject) => {
|
return new EmberPromise((resolve, reject) => {
|
||||||
if (!this.get('sessionService.isGlobalAdmin') || !this.get('sessionService.isAdmin')) {
|
if (!this.get('sessionService.isGlobalAdmin') && !this.get('sessionService.isAdmin')) {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ export default Service.extend({
|
||||||
data.set('restore-file', file);
|
data.set('restore-file', file);
|
||||||
|
|
||||||
return new EmberPromise((resolve, reject) => {
|
return new EmberPromise((resolve, reject) => {
|
||||||
if (!this.get('sessionService.isGlobalAdmin') || !this.get('sessionService.isAdmin')) {
|
if (!this.get('sessionService.isGlobalAdmin') && !this.get('sessionService.isAdmin')) {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,6 @@ type ImportSpec struct {
|
||||||
// Overwrite current organization settings.
|
// Overwrite current organization settings.
|
||||||
OverwriteOrg bool `json:"overwriteOrg"`
|
OverwriteOrg bool `json:"overwriteOrg"`
|
||||||
|
|
||||||
// Recreate users.
|
|
||||||
CreateUsers bool `json:"createUsers"`
|
|
||||||
|
|
||||||
// As found in backup file.
|
// As found in backup file.
|
||||||
Manifest Manifest
|
Manifest Manifest
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ type DocumentMetaViewer struct {
|
||||||
|
|
||||||
// DocumentMetaEditor contains the "edit" metatdata content.
|
// DocumentMetaEditor contains the "edit" metatdata content.
|
||||||
type DocumentMetaEditor struct {
|
type DocumentMetaEditor struct {
|
||||||
PageID string `json:"pageId"`
|
SectionID string `json:"pageId"`
|
||||||
UserID string `json:"userId"`
|
UserID string `json:"userId"`
|
||||||
Action string `json:"action"`
|
Action string `json:"action"`
|
||||||
Created time.Time `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue