Skip to content

Commit

Permalink
Net 1227 v2 (#3073)
Browse files Browse the repository at this point in the history
* add list roles to pro and ce

* if not pro set user role to admin
  • Loading branch information
abhishek9686 committed Aug 27, 2024
1 parent a39da31 commit d95b96a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ func createUser(w http.ResponseWriter, r *http.Request) {
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
return
}
if !servercfg.IsPro {
user.PlatformRoleID = models.AdminRole
}

if user.PlatformRoleID == "" {
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("platform role is missing"), "badrequest"))
Expand Down

0 comments on commit d95b96a

Please sign in to comment.