mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* Move SignedInUser to user service and RoleType and Roles to org * Use go naming convention for roles * Fix some imports and leftovers * Fix ldap debug test * Fix lint * Fix lint 2 * Fix lint 3 * Fix type and not needed conversion * Clean up messages in api tests * Clean up api tests 2
27 lines
564 B
Go
27 lines
564 B
Go
package manager
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/user"
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
type TeamGuardianMock struct {
|
|
mock.Mock
|
|
ExpectedError error
|
|
}
|
|
|
|
func NewTeamGuardianMock() *TeamGuardianMock {
|
|
return &TeamGuardianMock{}
|
|
}
|
|
|
|
func (t *TeamGuardianMock) CanAdmin(ctx context.Context, orgId int64, teamId int64, user *user.SignedInUser) error {
|
|
args := t.Called(ctx, orgId, teamId, user)
|
|
return args.Error(0)
|
|
}
|
|
|
|
func (t *TeamGuardianMock) DeleteByUser(ctx context.Context, userID int64) error {
|
|
return t.ExpectedError
|
|
}
|