Skip to content

Commit

Permalink
Update AssignRole, RemoveRole and add new UpdateRole handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <[email protected]>
  • Loading branch information
rdimitrov committed Jun 20, 2024
1 parent cfeaed8 commit 84f4875
Show file tree
Hide file tree
Showing 3 changed files with 418 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 84f4875

Please sign in to comment.