mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
Add ADMIN field to user.
This commit is contained in:
parent
43115f44f2
commit
6fffd722e6
@ -54,6 +54,9 @@ type User struct {
|
|||||||
// emptied during JSON marshall.
|
// emptied during JSON marshall.
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
|
|
||||||
|
// Tells if this user is an admin.
|
||||||
|
Admin bool `json:"admin"`
|
||||||
|
|
||||||
// FileSystem is the virtual file system the user has access.
|
// FileSystem is the virtual file system the user has access.
|
||||||
FileSystem webdav.Dir `json:"filesystem"`
|
FileSystem webdav.Dir `json:"filesystem"`
|
||||||
|
|
||||||
@ -103,6 +106,7 @@ var DefaultUser = User{
|
|||||||
Commands: []string{},
|
Commands: []string{},
|
||||||
Rules: []*Rule{},
|
Rules: []*Rule{},
|
||||||
CSS: "",
|
CSS: "",
|
||||||
|
Admin: true,
|
||||||
FileSystem: webdav.Dir("."),
|
FileSystem: webdav.Dir("."),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +164,8 @@ func New(database string, base User) (*FileManager, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The first user must be an administrator.
|
||||||
|
base.Admin = true
|
||||||
base.Password = pw
|
base.Password = pw
|
||||||
|
|
||||||
// Saves the user to the database.
|
// Saves the user to the database.
|
||||||
|
Loading…
Reference in New Issue
Block a user