mirror of
https://github.com/owncloud/ocis
synced 2026-04-26 01:35:25 +02:00
proxy: Add an interface for user role assignment
This moves the lookup and the creation of the users' role assignemt out of the user backend into its own interface. This makes the user backend a bit simpler and allows to provide different implemenation for the user role assignment more easily.
This commit is contained in:
committed by
Ralf Haferkamp
parent
490a835a3a
commit
d57d52b33d
@@ -97,29 +97,6 @@ func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GetUserRoles provides a mock function with given fields: ctx, user
|
||||
func (_m *UserBackend) GetUserRoles(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok {
|
||||
r1 = rf(ctx, user)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewUserBackend interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
|
||||
Reference in New Issue
Block a user