Serviceaccounts: feat - tabview for serviceaccounts (#43573)

This commit is contained in:
Eric Leijonmarck
2022-01-05 15:32:38 +01:00
committed by GitHub
parent 5c88acd5aa
commit 0aa905bb1f
16 changed files with 435 additions and 5 deletions

View File

@@ -61,3 +61,9 @@ func (sa *ServiceAccountsService) DeleteServiceAccount(ctx context.Context, orgI
}
return sa.store.DeleteServiceAccount(ctx, orgID, serviceAccountID)
}
func (sa *ServiceAccountsService) Migrated(ctx context.Context, orgID int64) bool {
// TODO: implement migration logic
// change this to return true for development of service accounts page
return false
}

View File

@@ -9,7 +9,9 @@ import (
type Service interface {
CreateServiceAccount(ctx context.Context, saForm *CreateServiceaccountForm) (*models.User, error)
DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error
Migrated(ctx context.Context, orgID int64) bool
}
type Store interface {
CreateServiceAccount(ctx context.Context, saForm *CreateServiceaccountForm) (*models.User, error)
DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error

View File

@@ -37,6 +37,10 @@ func (s *ServiceAccountMock) DeleteServiceAccount(ctx context.Context, orgID, se
return nil
}
func (s *ServiceAccountMock) Migrated(ctx context.Context, orgID int64) bool {
return false
}
func SetupMockAccesscontrol(t *testing.T, userpermissionsfunc func(c context.Context, siu *models.SignedInUser) ([]*accesscontrol.Permission, error), disableAccessControl bool) *accesscontrolmock.Mock {
t.Helper()
acmock := accesscontrolmock.New()