abhishek9686 преди 1 година
родител
ревизия
d02e2a5f8c
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      controllers/user.go

+ 3 - 0
controllers/user.go

@@ -407,6 +407,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"))