assignment

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package assignment 赋权命令应用服务

Package assignment 赋权查询应用服务

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentCommandService

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

AssignmentCommandService 赋权命令服务(实现 AssignmentCommander 接口) 负责协调领域服务、仓储和外部端口,处理赋权的写操作 核心职责:管理数据库和 Casbin 的双写事务一致性

func NewAssignmentCommandService

func NewAssignmentCommandService(
	assignmentValidator assignmentDomain.Validator,
	uow authzuow.UnitOfWork,
	casbinAdapter policyDomain.CasbinAdapter,
	versionNotifier policyDomain.VersionNotifier,
) *AssignmentCommandService

NewAssignmentCommandService 创建赋权命令服务

func (*AssignmentCommandService) Grant

Grant 授权(赋予角色)

func (*AssignmentCommandService) Revoke

Revoke 撤销授权(移除角色)

func (*AssignmentCommandService) RevokeByID

RevokeByID 根据ID撤销授权

type AssignmentQueryService

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

AssignmentQueryService 赋权查询服务(实现 AssignmentQueryer 接口) 负责赋权的读操作,遵循 CQRS 原则

func NewAssignmentQueryService

func NewAssignmentQueryService(
	assignmentValidator assignmentDomain.Validator,
	assignmentRepo assignmentDomain.Repository,
) *AssignmentQueryService

NewAssignmentQueryService 创建赋权查询服务

func (*AssignmentQueryService) ListByRole

ListByRole 根据角色列出赋权

func (*AssignmentQueryService) ListBySubject

ListBySubject 根据主体列出赋权

Jump to

Keyboard shortcuts

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