Skip to content

Commit

Permalink
Update AssignRole, RemoveRole and add new UpdateRole handlers (#3672)
Browse files Browse the repository at this point in the history
* Update AssignRole, RemoveRole and add new UpdateRole handlers

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>

* Update error types based on review feedback

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>

* Do not validate the email

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>

---------

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
rdimitrov authored Jun 20, 2024
1 parent d08b8f6 commit 7a3bce6
Show file tree
Hide file tree
Showing 3 changed files with 379 additions and 40 deletions.
3 changes: 3 additions & 0 deletions internal/authz/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (r Role) String() string {

// ParseRole parses a string into a Role
func ParseRole(r string) (Role, error) {
if r == "" {
return "", fmt.Errorf("role cannot be empty")
}
rr := Role(r)
if _, ok := AllRoles[rr]; !ok {
return "", fmt.Errorf("invalid role %s", r)
Expand Down
Loading

0 comments on commit 7a3bce6

Please sign in to comment.