PLT-4202 fix javascript error manage OAuth2 apps (#4039)
* PLT-4202 fix javascript error manage OAuth2 apps * Fix unit tests
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
4e3d465210
Коммит
33e20b874e
@@ -102,6 +102,7 @@ func getOAuthApps(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if HasPermissionToContext(c, model.PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH) {
|
||||
ochan = Srv.Store.OAuth().GetApps()
|
||||
} else {
|
||||
c.Err = nil
|
||||
ochan = Srv.Store.OAuth().GetAppByUser(c.Session.UserId)
|
||||
}
|
||||
|
||||
|
||||
@@ -156,8 +156,8 @@ func TestGetOAuthAppsByUser(t *testing.T) {
|
||||
|
||||
utils.Cfg.ServiceSettings.EnableOAuthServiceProvider = true
|
||||
|
||||
if _, err := Client.GetOAuthAppsByUser(); err == nil {
|
||||
t.Fatal("Should have failed. only admin is permitted")
|
||||
if _, err := Client.GetOAuthAppsByUser(); err != nil {
|
||||
t.Fatal("Should have passed.")
|
||||
}
|
||||
|
||||
*utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations = false
|
||||
|
||||
Ссылка в новой задаче
Block a user