Net 1227 v2 (#3073)

* add list roles to pro and ce

* if not pro set user role to admin
This commit is contained in:
Abhishek K 2024-08-27 12:14:57 +05:30 committed by GitHub
parent a39da31fa6
commit d95b96ad6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"))