Add profile 3D preferences and adapt DICOM preview resolution to memory budget
This commit is contained in:
1 parent
705762d57c
commit
7fd7ae6733
22 files changed
+500
-68
No files matched your search
+28
-21
@@ -19,27 +19,28 @@ 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"`
|
||||
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"`
|
||||
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.
|
||||
@@ -55,6 +56,7 @@ var checkableFields = []string{
|
||||
"Commands",
|
||||
"Sorting",
|
||||
"Rules",
|
||||
"Dicom3D",
|
||||
}
|
||||
|
||||
// Clean cleans up a user and verifies if all its fields
|
||||
@@ -66,6 +68,11 @@ func (u *User) Clean(baseScope string, followExternalSymlinks bool, fields ...st
|
||||
|
||||
for _, field := range fields {
|
||||
switch field {
|
||||
case "Dicom3D":
|
||||
if !u.Dicom3D.Valid() {
|
||||
return fberrors.ErrInvalidRequestParams
|
||||
}
|
||||
u.Dicom3D = u.Dicom3D.Normalized()
|
||||
case "Username":
|
||||
if u.Username == "" {
|
||||
return fberrors.ErrEmptyUsername
|
||||
|
||||
Reference in new issue
Block a user