AuthN: Extract enable disabled users logic to its own hook (#63628)
This commit is contained in:
@@ -17,6 +17,7 @@ type FakeUserService struct {
|
||||
|
||||
GetSignedInUserFn func(ctx context.Context, query *user.GetSignedInUserQuery) (*user.SignedInUser, error)
|
||||
CreateFn func(ctx context.Context, cmd *user.CreateUserCommand) (*user.User, error)
|
||||
DisableFn func(ctx context.Context, cmd *user.DisableUserCommand) error
|
||||
|
||||
counter int
|
||||
}
|
||||
@@ -96,6 +97,9 @@ func (f *FakeUserService) Search(ctx context.Context, query *user.SearchUsersQue
|
||||
}
|
||||
|
||||
func (f *FakeUserService) Disable(ctx context.Context, cmd *user.DisableUserCommand) error {
|
||||
if f.DisableFn != nil {
|
||||
return f.DisableFn(ctx, cmd)
|
||||
}
|
||||
return f.ExpectedError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user