Reference known issue #2601 in Admin creating SuperAdmin response
Signed-off-by: Michael de Sa <mjdesa@gmail.com>pull/10616/head
parent
ad22233adb
commit
fbc224107e
|
@ -401,7 +401,7 @@ func TestServer(t *testing.T) {
|
||||||
body: `
|
body: `
|
||||||
{
|
{
|
||||||
"code": 401,
|
"code": 401,
|
||||||
"message": "User does not have authorization required to set SuperAdmin status"
|
"message": "User does not have authorization required to set SuperAdmin status. See https://github.com/influxdata/chronograf/issues/2601 for more information."
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -324,7 +324,7 @@ func setSuperAdmin(ctx context.Context, req userRequest, user *chronograf.User)
|
||||||
} else if !isSuperAdmin && (user.SuperAdmin != req.SuperAdmin) {
|
} else if !isSuperAdmin && (user.SuperAdmin != req.SuperAdmin) {
|
||||||
// If req.SuperAdmin has been set, and the request was not made with the SuperAdmin
|
// If req.SuperAdmin has been set, and the request was not made with the SuperAdmin
|
||||||
// context, return error
|
// context, return error
|
||||||
return fmt.Errorf("User does not have authorization required to set SuperAdmin status")
|
return fmt.Errorf("User does not have authorization required to set SuperAdmin status. See https://github.com/influxdata/chronograf/issues/2601 for more information.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -334,7 +334,7 @@ func TestService_NewUser(t *testing.T) {
|
||||||
},
|
},
|
||||||
wantStatus: http.StatusUnauthorized,
|
wantStatus: http.StatusUnauthorized,
|
||||||
wantContentType: "application/json",
|
wantContentType: "application/json",
|
||||||
wantBody: `{"code":401,"message":"User does not have authorization required to set SuperAdmin status"}`,
|
wantBody: `{"code":401,"message":"User does not have authorization required to set SuperAdmin status. See https://github.com/influxdata/chronograf/issues/2601 for more information."}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Create a new SuperAdmin User - as superadmin",
|
name: "Create a new SuperAdmin User - as superadmin",
|
||||||
|
@ -900,7 +900,7 @@ func TestService_UpdateUser(t *testing.T) {
|
||||||
id: "1336",
|
id: "1336",
|
||||||
wantStatus: http.StatusUnauthorized,
|
wantStatus: http.StatusUnauthorized,
|
||||||
wantContentType: "application/json",
|
wantContentType: "application/json",
|
||||||
wantBody: `{"code":401,"message":"User does not have authorization required to set SuperAdmin status"}`,
|
wantBody: `{"code":401,"message":"User does not have authorization required to set SuperAdmin status. See https://github.com/influxdata/chronograf/issues/2601 for more information."}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Update a Chronograf user to super admin - with super admin context",
|
name: "Update a Chronograf user to super admin - with super admin context",
|
||||||
|
|
Loading…
Reference in New Issue