Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignSystemRoleByEmailCommand ¶
type AssignSystemRoleByEmailCommand struct {
Email string
FullName string
Role entity.SystemRole
GrantedBy string
}
AssignSystemRoleByEmailCommand represents the command to assign a system role by email.
type AssignSystemRoleCommand ¶
type AssignSystemRoleCommand struct {
UserID string
Role entity.SystemRole
GrantedBy string
}
AssignSystemRoleCommand represents the command to assign a system role.
type RecordAccessCommand ¶
type RecordAccessCommand struct {
UserID string
EntityType entity.AccessEntityType
EntityID string
}
RecordAccessCommand contains data for recording a resource access.
type RevokeSystemRoleCommand ¶
RevokeSystemRoleCommand represents the command to revoke a system role.
type SystemRoleUseCase ¶
type SystemRoleUseCase interface {
// ListUsersWithSystemRoles lists all users that have system roles.
ListUsersWithSystemRoles(ctx context.Context) ([]*entity.SystemRoleWithUser, error)
// AssignRole assigns a system role to a user.
AssignRole(ctx context.Context, cmd AssignSystemRoleCommand) (*entity.SystemRoleAssignment, error)
// AssignRoleByEmail assigns a system role to a user identified by email.
// Creates a shadow user if the email doesn't exist.
AssignRoleByEmail(ctx context.Context, cmd AssignSystemRoleByEmailCommand) (*entity.SystemRoleWithUser, error)
// RevokeRole revokes a user's system role.
RevokeRole(ctx context.Context, cmd RevokeSystemRoleCommand) error
// GetUserSystemRole gets a user's system role.
GetUserSystemRole(ctx context.Context, userID string) (*entity.SystemRoleAssignment, error)
}
SystemRoleUseCase defines the input port for system role operations.
type UserAccessHistoryUseCase ¶
type UserAccessHistoryUseCase interface {
// RecordTenantAccess records that a user accessed a tenant.
RecordTenantAccess(ctx context.Context, userID, tenantID string) error
// RecordWorkspaceAccess records that a user accessed a workspace.
RecordWorkspaceAccess(ctx context.Context, userID, workspaceID string) error
// GetRecentTenantIDs returns the IDs of recently accessed tenants for a user.
GetRecentTenantIDs(ctx context.Context, userID string) ([]string, error)
// GetRecentWorkspaceIDs returns the IDs of recently accessed workspaces for a user.
GetRecentWorkspaceIDs(ctx context.Context, userID string) ([]string, error)
}
UserAccessHistoryUseCase defines the interface for user access history operations.
Click to show internal directories.
Click to hide internal directories.