Simplify API endpoints; add endpoint tests
This commit is contained in:
parent
7ca9afad57
commit
367d024a2d
6 changed files with 113 additions and 75 deletions
|
@ -336,8 +336,7 @@ func (a *Manager) resolvePerms(read, write bool, perm Permission) error {
|
|||
return ErrUnauthorized
|
||||
}
|
||||
|
||||
// AddUser adds a user with the given username, password and role. The password should be hashed
|
||||
// before it is stored in a persistence layer.
|
||||
// AddUser adds a user with the given username, password and role
|
||||
func (a *Manager) AddUser(username, password string, role Role) error {
|
||||
if !AllowedUsername(username) || !AllowedRole(role) {
|
||||
return ErrInvalidArgument
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue