mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* [MM-61756] Attribute Based Access Control - Phase 1 (#30785)
Attribute Based Access Control - Base
* MM-63662
* MM-63919
* MM-63954
* MM-63955
* MM-63425
* MM-63426
* MM-63458
* MM-63459
* MM-63603
* MM-63845
* MM-64146
* MM-64199
* MM-64201
* MM-64233
* MM-64247
* MM-64268
---------
Co-authored-by: Harshil Sharma <[email protected]>
Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]>
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
(cherry picked from commit 4a5e5b4d87)
* trigger CI
---------
Co-authored-by: Ibrahim Serdar Acikgoz <[email protected]>
Co-authored-by: Harshil Sharma <[email protected]>
Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]>
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
176 lines
4.8 KiB
Go
176 lines
4.8 KiB
Go
// Code generated by mockery v2.42.2. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make store-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// AccessControlPolicyStore is an autogenerated mock type for the AccessControlPolicyStore type
|
|
type AccessControlPolicyStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: c, id
|
|
func (_m *AccessControlPolicyStore) Delete(c request.CTX, id string) error {
|
|
ret := _m.Called(c, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
|
r0 = rf(c, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Get provides a mock function with given fields: c, id
|
|
func (_m *AccessControlPolicyStore) Get(c request.CTX, id string) (*model.AccessControlPolicy, error) {
|
|
ret := _m.Called(c, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.AccessControlPolicy, error)); ok {
|
|
return rf(c, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AccessControlPolicy); ok {
|
|
r0 = rf(c, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
|
r1 = rf(c, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Save provides a mock function with given fields: c, policy
|
|
func (_m *AccessControlPolicyStore) Save(c request.CTX, policy *model.AccessControlPolicy) (*model.AccessControlPolicy, error) {
|
|
ret := _m.Called(c, policy)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Save")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) (*model.AccessControlPolicy, error)); ok {
|
|
return rf(c, policy)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) *model.AccessControlPolicy); ok {
|
|
r0 = rf(c, policy)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.AccessControlPolicy) error); ok {
|
|
r1 = rf(c, policy)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SearchPolicies provides a mock function with given fields: rctx, opts
|
|
func (_m *AccessControlPolicyStore) SearchPolicies(rctx request.CTX, opts model.AccessControlPolicySearch) ([]*model.AccessControlPolicy, int64, error) {
|
|
ret := _m.Called(rctx, opts)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SearchPolicies")
|
|
}
|
|
|
|
var r0 []*model.AccessControlPolicy
|
|
var r1 int64
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessControlPolicySearch) ([]*model.AccessControlPolicy, int64, error)); ok {
|
|
return rf(rctx, opts)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessControlPolicySearch) []*model.AccessControlPolicy); ok {
|
|
r0 = rf(rctx, opts)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, model.AccessControlPolicySearch) int64); ok {
|
|
r1 = rf(rctx, opts)
|
|
} else {
|
|
r1 = ret.Get(1).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(request.CTX, model.AccessControlPolicySearch) error); ok {
|
|
r2 = rf(rctx, opts)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetActiveStatus provides a mock function with given fields: c, id, active
|
|
func (_m *AccessControlPolicyStore) SetActiveStatus(c request.CTX, id string, active bool) (*model.AccessControlPolicy, error) {
|
|
ret := _m.Called(c, id, active)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SetActiveStatus")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) (*model.AccessControlPolicy, error)); ok {
|
|
return rf(c, id, active)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, bool) *model.AccessControlPolicy); ok {
|
|
r0 = rf(c, id, active)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, bool) error); ok {
|
|
r1 = rf(c, id, active)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewAccessControlPolicyStore creates a new instance of AccessControlPolicyStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewAccessControlPolicyStore(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *AccessControlPolicyStore {
|
|
mock := &AccessControlPolicyStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|