tests

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserRolesUseCaseFixture

func NewUserRolesUseCaseFixture() (usecases.UserRolesUseCase, *mockUserAccessRepository)

Types

type MockRolePermissionRepository

type MockRolePermissionRepository struct {
	mock.Mock
}

func NewMockRolePermissionRepository

func NewMockRolePermissionRepository() *MockRolePermissionRepository

func (*MockRolePermissionRepository) AddRolePermission

func (m *MockRolePermissionRepository) AddRolePermission(ctx context.Context, roleID string, permissionID string, grantedByUserID *string) error

func (*MockRolePermissionRepository) AssignUserRole

func (m *MockRolePermissionRepository) AssignUserRole(ctx context.Context, userID string, roleID string, assignedByUserID *string, expiresAt *time.Time) error

func (*MockRolePermissionRepository) CountRoleAssignmentsByPermissionID

func (m *MockRolePermissionRepository) CountRoleAssignmentsByPermissionID(ctx context.Context, permissionID string) (int, error)

func (*MockRolePermissionRepository) CountUserAssignmentsByRoleID

func (m *MockRolePermissionRepository) CountUserAssignmentsByRoleID(ctx context.Context, roleID string) (int, error)

func (*MockRolePermissionRepository) CreatePermission

func (m *MockRolePermissionRepository) CreatePermission(ctx context.Context, permission *types.Permission) error

func (*MockRolePermissionRepository) CreateRole

func (m *MockRolePermissionRepository) CreateRole(ctx context.Context, role *types.Role) error

func (*MockRolePermissionRepository) DeletePermission

func (m *MockRolePermissionRepository) DeletePermission(ctx context.Context, permissionID string) (bool, error)

func (*MockRolePermissionRepository) DeleteRole

func (m *MockRolePermissionRepository) DeleteRole(ctx context.Context, roleID string) (bool, error)

func (*MockRolePermissionRepository) GetAllPermissions

func (m *MockRolePermissionRepository) GetAllPermissions(ctx context.Context) ([]types.Permission, error)

func (*MockRolePermissionRepository) GetAllRoles

func (m *MockRolePermissionRepository) GetAllRoles(ctx context.Context) ([]types.Role, error)

func (*MockRolePermissionRepository) GetPermissionByID

func (m *MockRolePermissionRepository) GetPermissionByID(ctx context.Context, permissionID string) (*types.Permission, error)

func (*MockRolePermissionRepository) GetRoleByID

func (m *MockRolePermissionRepository) GetRoleByID(ctx context.Context, roleID string) (*types.Role, error)

func (*MockRolePermissionRepository) GetRolePermissions

func (m *MockRolePermissionRepository) GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error)

func (*MockRolePermissionRepository) RemoveRolePermission

func (m *MockRolePermissionRepository) RemoveRolePermission(ctx context.Context, roleID string, permissionID string) error

func (*MockRolePermissionRepository) RemoveUserRole

func (m *MockRolePermissionRepository) RemoveUserRole(ctx context.Context, userID string, roleID string) error

func (*MockRolePermissionRepository) ReplaceRolePermissions

func (m *MockRolePermissionRepository) ReplaceRolePermissions(ctx context.Context, roleID string, permissionIDs []string, grantedByUserID *string) error

func (*MockRolePermissionRepository) ReplaceUserRoles

func (m *MockRolePermissionRepository) ReplaceUserRoles(ctx context.Context, userID string, roleIDs []string, assignedByUserID *string) error

func (*MockRolePermissionRepository) UpdatePermission

func (m *MockRolePermissionRepository) UpdatePermission(ctx context.Context, permissionID string, description *string) (bool, error)

func (*MockRolePermissionRepository) UpdateRole

func (m *MockRolePermissionRepository) UpdateRole(ctx context.Context, roleID string, name *string, description *string) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL