2022-06-28 14:32:25 +02:00
|
|
|
package user
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2023-04-18 14:34:40 +01:00
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/registry"
|
2022-06-28 14:32:25 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Service interface {
|
2023-04-18 14:34:40 +01:00
|
|
|
registry.ProvidesUsageStats
|
2022-06-28 14:32:25 +02:00
|
|
|
Create(context.Context, *CreateUserCommand) (*User, error)
|
2022-12-07 17:03:22 +01:00
|
|
|
CreateServiceAccount(context.Context, *CreateUserCommand) (*User, error)
|
2022-07-19 16:01:05 +02:00
|
|
|
Delete(context.Context, *DeleteUserCommand) error
|
2022-08-02 16:58:05 +02:00
|
|
|
GetByID(context.Context, *GetUserByIDQuery) (*User, error)
|
2022-08-04 13:22:43 +02:00
|
|
|
GetByLogin(context.Context, *GetUserByLoginQuery) (*User, error)
|
2022-08-04 13:47:30 +02:00
|
|
|
GetByEmail(context.Context, *GetUserByEmailQuery) (*User, error)
|
2022-08-04 14:22:44 +02:00
|
|
|
Update(context.Context, *UpdateUserCommand) error
|
2022-08-04 15:05:05 +02:00
|
|
|
ChangePassword(context.Context, *ChangeUserPasswordCommand) error
|
2022-08-04 15:44:14 +02:00
|
|
|
UpdateLastSeenAt(context.Context, *UpdateUserLastSeenAtCommand) error
|
2022-08-11 13:28:55 +02:00
|
|
|
SetUsingOrg(context.Context, *SetUsingOrgCommand) error
|
|
|
|
|
GetSignedInUserWithCacheCtx(context.Context, *GetSignedInUserQuery) (*SignedInUser, error)
|
2022-08-12 12:13:26 +02:00
|
|
|
GetSignedInUser(context.Context, *GetSignedInUserQuery) (*SignedInUser, error)
|
2022-11-03 09:03:29 -04:00
|
|
|
NewAnonymousSignedInUser(context.Context) (*SignedInUser, error)
|
2022-08-12 12:13:26 +02:00
|
|
|
Search(context.Context, *SearchUsersQuery) (*SearchUserQueryResult, error)
|
|
|
|
|
Disable(context.Context, *DisableUserCommand) error
|
|
|
|
|
BatchDisableUsers(context.Context, *BatchDisableUsersCommand) error
|
2022-10-04 14:14:32 +02:00
|
|
|
UpdatePermissions(context.Context, int64, bool) error
|
2022-08-12 12:13:26 +02:00
|
|
|
SetUserHelpFlag(context.Context, *SetUserHelpFlagCommand) error
|
2022-10-04 14:14:32 +02:00
|
|
|
GetProfile(context.Context, *GetUserProfileQuery) (*UserProfileDTO, error)
|
2022-06-28 14:32:25 +02:00
|
|
|
}
|