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