mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-08 17:30:47 +08:00
Moved CreateUser function int into user.go
This commit is contained in:
@@ -261,6 +261,24 @@ func (user *User) Replace(new *User) {
|
||||
user.ExcludedPubSubChannels = new.ExcludedPubSubChannels
|
||||
}
|
||||
|
||||
func CreateUser(username string) *User {
|
||||
return &User{
|
||||
Username: username,
|
||||
Enabled: true,
|
||||
NoPassword: false,
|
||||
Passwords: []Password{},
|
||||
IncludedCategories: []string{},
|
||||
ExcludedCategories: []string{},
|
||||
IncludedCommands: []string{},
|
||||
ExcludedCommands: []string{},
|
||||
IncludedKeys: []string{},
|
||||
IncludedReadKeys: []string{},
|
||||
IncludedWriteKeys: []string{},
|
||||
IncludedPubSubChannels: []string{},
|
||||
ExcludedPubSubChannels: []string{},
|
||||
}
|
||||
}
|
||||
|
||||
func GetPasswordType(password string) string {
|
||||
if password[0] == '#' {
|
||||
return "SHA256"
|
||||
|
Reference in New Issue
Block a user