feat: Added userplus role in IAM, who has the same opportunities as the user, but may also create a bucket

This commit is contained in:
jonaustin09
2024-02-20 14:24:26 -05:00
parent 8d229b5878
commit fa54dfeb9f
7 changed files with 23 additions and 15 deletions
+2 -2
View File
@@ -43,8 +43,8 @@ func (c AdminController) CreateUser(ctx *fiber.Ctx) error {
return fmt.Errorf("failed to parse request body: %w", err)
}
if usr.Role != "user" && usr.Role != "admin" {
return fmt.Errorf("invalid parameters: user role have to be one of the following: 'user', 'admin'")
if usr.Role != auth.RoleAdmin && usr.Role != auth.RoleUser && usr.Role != auth.RoleUserPlus {
return fmt.Errorf("invalid parameters: user role have to be one of the following: 'user', 'admin', 'userplus'")
}
err = c.iam.CreateAccount(usr)