Browse Source

Net 1227 v2 (#3073)

* add list roles to pro and ce

* if not pro set user role to admin
Abhishek K 1 năm trước cách đây
mục cha
commit
d95b96ad6e
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      controllers/user.go

+ 3 - 0
controllers/user.go

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