mirror of
https://github.com/grafana/grafana.git
synced 2026-08-19 01:34:54 -05:00
Service accounts: RBAC the service account UI (#47788)
* WIP * fix: bug for saving name did not remove edit * refactor: better error msg * Display the column Roles even when user can't see the role picker * Remove spaces when building the search query request * Disable Edit button and fix token addition and deletion * Fix the error message text Co-authored-by: Vardan Torosyan <vardants@gmail.com>
This commit is contained in:
co-authored by
Vardan Torosyan
parent
2a178bd73c
commit
b43e9b50b4
@@ -17,14 +17,14 @@ func (e *ErrSAInvalidName) Unwrap() error {
|
||||
return models.ErrUserAlreadyExists
|
||||
}
|
||||
|
||||
type ErrMisingSAToken struct {
|
||||
type ErrMissingSAToken struct {
|
||||
}
|
||||
|
||||
func (e *ErrMisingSAToken) Error() string {
|
||||
func (e *ErrMissingSAToken) Error() string {
|
||||
return "service account token not found"
|
||||
}
|
||||
|
||||
func (e *ErrMisingSAToken) Unwrap() error {
|
||||
func (e *ErrMissingSAToken) Unwrap() error {
|
||||
return models.ErrApiKeyNotFound
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ type ErrDuplicateSAToken struct {
|
||||
}
|
||||
|
||||
func (e *ErrDuplicateSAToken) Error() string {
|
||||
return fmt.Sprintf("service account token %s already exists", e.name)
|
||||
return fmt.Sprintf("service account token %s already exists in the organization", e.name)
|
||||
}
|
||||
|
||||
func (e *ErrDuplicateSAToken) Unwrap() error {
|
||||
|
||||
@@ -57,7 +57,7 @@ func (s *ServiceAccountsStoreImpl) DeleteServiceAccountToken(ctx context.Context
|
||||
if err != nil {
|
||||
return err
|
||||
} else if n == 0 {
|
||||
return &ErrMisingSAToken{}
|
||||
return &ErrMissingSAToken{}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user