access

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSystemRoleService

func NewSystemRoleService(
	systemRoleRepo port.SystemRoleRepository,
	userRepo port.UserRepository,
) accessuc.SystemRoleUseCase

NewSystemRoleService creates a new system role service.

func NewUserAccessHistoryService

func NewUserAccessHistoryService(
	accessHistoryRepo port.UserAccessHistoryRepository,
) accessuc.UserAccessHistoryUseCase

NewUserAccessHistoryService creates a new user access history service.

Types

type SystemRoleService

type SystemRoleService struct {
	// contains filtered or unexported fields
}

SystemRoleService implements the SystemRoleUseCase interface.

func (*SystemRoleService) AssignRole

AssignRole assigns a system role to a user.

func (*SystemRoleService) AssignRoleByEmail

AssignRoleByEmail assigns a system role to a user identified by email. Creates a shadow user if the email doesn't exist.

func (*SystemRoleService) GetUserSystemRole

func (s *SystemRoleService) GetUserSystemRole(ctx context.Context, userID string) (*entity.SystemRoleAssignment, error)

GetUserSystemRole gets a user's system role.

func (*SystemRoleService) ListUsersWithSystemRoles

func (s *SystemRoleService) ListUsersWithSystemRoles(ctx context.Context) ([]*entity.SystemRoleWithUser, error)

ListUsersWithSystemRoles lists all users that have system roles.

func (*SystemRoleService) RevokeRole

RevokeRole revokes a user's system role.

type UserAccessHistoryService

type UserAccessHistoryService struct {
	// contains filtered or unexported fields
}

UserAccessHistoryService implements user access history business logic.

func (*UserAccessHistoryService) GetRecentTenantIDs

func (s *UserAccessHistoryService) GetRecentTenantIDs(ctx context.Context, userID string) ([]string, error)

GetRecentTenantIDs returns the IDs of recently accessed tenants.

func (*UserAccessHistoryService) GetRecentWorkspaceIDs

func (s *UserAccessHistoryService) GetRecentWorkspaceIDs(ctx context.Context, userID string) ([]string, error)

GetRecentWorkspaceIDs returns the IDs of recently accessed workspaces.

func (*UserAccessHistoryService) RecordTenantAccess

func (s *UserAccessHistoryService) RecordTenantAccess(ctx context.Context, userID, tenantID string) error

RecordTenantAccess records that a user accessed a tenant. Access is validated in the database: user must have tenant membership OR a system role.

func (*UserAccessHistoryService) RecordWorkspaceAccess

func (s *UserAccessHistoryService) RecordWorkspaceAccess(ctx context.Context, userID, workspaceID string) error

RecordWorkspaceAccess records that a user accessed a workspace. Access is validated in the database: user must have workspace membership OR a system role.

Jump to

Keyboard shortcuts

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