feat: improve ArtCraft integration and configurable file opening
This commit is contained in:
1 parent
3bc62d2b69
commit
80bc2c458d
60 files changed
+1738
-232
No files matched your search
+30
-22
@@ -19,28 +19,29 @@ const (
|
||||
|
||||
// User describes a user.
|
||||
type User struct {
|
||||
ID uint `storm:"id,increment" json:"id"`
|
||||
Username string `storm:"unique" json:"username"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
ProfileName string `json:"profileName,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Password string `json:"password"`
|
||||
Scope string `json:"scope"`
|
||||
Locale string `json:"locale"`
|
||||
LockPassword bool `json:"lockPassword"`
|
||||
ViewMode ViewMode `json:"viewMode"`
|
||||
SingleClick bool `json:"singleClick"`
|
||||
RedirectAfterCopyMove bool `json:"redirectAfterCopyMove"`
|
||||
Perm Permissions `json:"perm"`
|
||||
Commands []string `json:"commands"`
|
||||
Sorting files.Sorting `json:"sorting"`
|
||||
Fs afero.Fs `json:"-" yaml:"-"`
|
||||
Rules []rules.Rule `json:"rules"`
|
||||
HideDotfiles bool `json:"hideDotfiles"`
|
||||
HidePreviews bool `json:"hidePreviews"`
|
||||
Dicom3D Dicom3DSettings `json:"dicom3D"`
|
||||
DateFormat bool `json:"dateFormat"`
|
||||
AceEditorTheme string `json:"aceEditorTheme"`
|
||||
ID uint `storm:"id,increment" json:"id"`
|
||||
Username string `storm:"unique" json:"username"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
ProfileName string `json:"profileName,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Password string `json:"password"`
|
||||
Scope string `json:"scope"`
|
||||
Locale string `json:"locale"`
|
||||
LockPassword bool `json:"lockPassword"`
|
||||
ViewMode ViewMode `json:"viewMode"`
|
||||
SingleClick bool `json:"singleClick"`
|
||||
AutoOpen map[string]string `json:"autoOpen"`
|
||||
RedirectAfterCopyMove bool `json:"redirectAfterCopyMove"`
|
||||
Perm Permissions `json:"perm"`
|
||||
Commands []string `json:"commands"`
|
||||
Sorting files.Sorting `json:"sorting"`
|
||||
Fs afero.Fs `json:"-" yaml:"-"`
|
||||
Rules []rules.Rule `json:"rules"`
|
||||
HideDotfiles bool `json:"hideDotfiles"`
|
||||
HidePreviews bool `json:"hidePreviews"`
|
||||
Dicom3D Dicom3DSettings `json:"dicom3D"`
|
||||
DateFormat bool `json:"dateFormat"`
|
||||
AceEditorTheme string `json:"aceEditorTheme"`
|
||||
}
|
||||
|
||||
// GetRules implements rules.Provider.
|
||||
@@ -57,6 +58,7 @@ var checkableFields = []string{
|
||||
"Sorting",
|
||||
"Rules",
|
||||
"Dicom3D",
|
||||
"AutoOpen",
|
||||
}
|
||||
|
||||
// Clean cleans up a user and verifies if all its fields
|
||||
@@ -68,6 +70,12 @@ func (u *User) Clean(baseScope string, followExternalSymlinks bool, fields ...st
|
||||
|
||||
for _, field := range fields {
|
||||
switch field {
|
||||
case "AutoOpen":
|
||||
var valid bool
|
||||
u.AutoOpen, valid = normalizeAutoOpen(u.AutoOpen)
|
||||
if !valid {
|
||||
return fberrors.ErrInvalidRequestParams
|
||||
}
|
||||
case "Dicom3D":
|
||||
if !u.Dicom3D.Valid() {
|
||||
return fberrors.ErrInvalidRequestParams
|
||||
|
||||
Reference in new issue
Block a user