feat: creation of service account (#44913)

* feat: creation of service account

* added back button for the details page

* refactor: remove unused file, renamed fields

* oppps
This commit is contained in:
Eric Leijonmarck
2022-02-07 14:12:39 +01:00
committed by GitHub
parent a8e9369084
commit 334c29eebf
8 changed files with 101 additions and 15 deletions

View File

@@ -27,9 +27,10 @@ func NewServiceAccountsStore(store *sqlstore.SQLStore) *ServiceAccountsStoreImpl
func (s *ServiceAccountsStoreImpl) CreateServiceAccount(ctx context.Context, sa *serviceaccounts.CreateServiceaccountForm) (user *models.User, err error) {
// create a new service account - "user" with empty permissions
generatedLogin := "Service-Account-" + uuid.New().String()
cmd := models.CreateUserCommand{
Login: "Service-Account-" + uuid.New().String(),
Name: sa.Name + "-Service-Account-" + uuid.New().String(),
Login: generatedLogin,
Name: sa.Name,
OrgId: sa.OrgID,
IsServiceAccount: true,
}