Versions in this module Expand all Collapse all v0 v0.0.25 Sep 13, 2025 v0.0.24 Sep 11, 2025 v0.0.23 Sep 11, 2025 v0.0.22 Sep 10, 2025 v0.0.21 Sep 10, 2025 v0.0.18 Sep 5, 2025 v0.0.16 Aug 29, 2025 v0.0.14 Aug 14, 2025 v0.0.11 Aug 3, 2025 v0.0.10 Jul 30, 2025 v0.0.9 Jul 25, 2025 v0.0.8 Jul 24, 2025 v0.0.7 Jul 24, 2025 v0.0.5 Jul 9, 2025 v0.0.4 Jul 7, 2025 Changes in this version + type PermissionService interface + GetPermissionId func(name string) (int64, error) + GetPermissions func(ctx context.Context) (map[string]int64, error) + GetPermissionsForRole func(ctx context.Context, roleId int64) (map[string]bool, error) + HasPermission func(ctx context.Context, userID int64, permission string) (bool, error) + UserHasPermission func(ctx context.Context, userId int64, permission string) (bool, error) + Warmup func(ctx context.Context, allPermissions []string) error + func NewPermissionService(dbadapter dbinterface.Database, roleService RoleService) PermissionService + type PermissionServiceImpl struct + func (p *PermissionServiceImpl) AsPermissionService() PermissionService + func (p *PermissionServiceImpl) GetPermissionId(name string) (int64, error) + func (p *PermissionServiceImpl) GetPermissions(ctx context.Context) (map[string]int64, error) + func (p *PermissionServiceImpl) GetPermissionsForRole(ctx context.Context, roleId int64) (map[string]bool, error) + func (p *PermissionServiceImpl) HasPermission(ctx context.Context, userID int64, permission string) (bool, error) + func (p *PermissionServiceImpl) UserHasPermission(ctx context.Context, userId int64, permission string) (bool, error) + func (p *PermissionServiceImpl) Warmup(ctx context.Context, allPermissions []string) error + type Response struct + Message string + Status string + ValidationIssues *ubvalidation.ValidationIssues + type RoleAggregate struct + Id int64 + Sequence int64 + State *RoleState + func NewRoleAggregate() RoleAggregate + func (a *RoleAggregate) ApplyEventState(eventState evercore.EventState, eventTime time.Time, reference string) error + func (a *RoleAggregate) ApplySnapshot(snapshot *evercore.Snapshot) error + func (a *RoleAggregate) AsAggregate() evercore.Aggregate + func (a *RoleAggregate) GetAggregateType() string + func (a *RoleAggregate) GetId() int64 + func (a *RoleAggregate) GetSequence() int64 + func (a *RoleAggregate) GetSnapshotFrequency() int64 + func (a *RoleAggregate) GetSnapshotState() (*string, error) + func (a *RoleAggregate) SetId(id int64) + func (a *RoleAggregate) SetSequence(seq int64) + type RolePermissions struct + Permissions []int64 + RoleId int64 + type RoleService interface + AddPermissionToRole func(ctx context.Context, role string, permissionId int64, agent string) error + AddRole func(ctx context.Context, name string, agent string) (int64, error) + GetRoleList func(ctx context.Context) (map[string]int64, error) + RemovePermissionFromRole func(ctx context.Context, role string, permissionId int64, agent string) error + func CreateRoleService(store *evercore.EventStore, dbadapter dbinterface.Database) RoleService + type RoleServiceImpl struct + func (s RoleServiceImpl) AddPermissionToRole(ctx context.Context, role string, permissionId int64, agent string) error + func (s RoleServiceImpl) AddRole(ctx context.Context, name string, agent string) (int64, error) + func (s RoleServiceImpl) GetRoleList(ctx context.Context) (map[string]int64, error) + func (s RoleServiceImpl) RemovePermissionFromRole(ctx context.Context, role string, permissionId int64, agent string) error + type RoleState struct + Name string + Premissions []int64 + type UserAggregate struct + type UserCreateCommand struct + DisplayName string + Email string + FirstName string + LastName string + Password string + func (r UserCreateCommand) Validate() *ubvalidation.ValidationIssues + type UserCreateResponse struct + Id int64 + type UserLoginCommand struct + Email string + Password string + type UserLoginResponse struct + DisplayName *string + Email *string + FirstName *string + LastName *string + UserId int64 + type UserRoles struct + Roles []int64 + UserId int64 + type UserService interface + CreateUser func(ctx context.Context, command UserCreateCommand, agent string) (UserCreateResponse, error) + GetUserByEmail func(ctx context.Context, email string) (*UserAggregate, error) + GetUserRolesIds func(ctx context.Context, userId int64) ([]int64, error) + Login func(ctx context.Context, command UserLoginCommand) (*UserLoginResponse, error) + SetRoles func(ctx context.Context, command UserSetRolesComand, agent string) (UserSetRolesResponse, error) + UpdateUser func(ctx context.Context, command UserUpdateCommand, agent string) (UserUpdatedResponse, error) + func CreateUserService(store *evercore.EventStore, hashingService ubsecurity.HashGenerator, ...) UserService + type UserServiceImpl struct + func (s UserServiceImpl) CreateUser(ctx context.Context, command UserCreateCommand, agent string) (UserCreateResponse, error) + func (s UserServiceImpl) GetUserByEmail(ctx context.Context, email string) (*UserAggregate, error) + func (s UserServiceImpl) GetUserRolesIds(ctx context.Context, userId int64) ([]int64, error) + func (s UserServiceImpl) Login(ctx context.Context, command UserLoginCommand) (*UserLoginResponse, error) + func (s UserServiceImpl) ProjectRoles(ctx context.Context, userAggregate *UserAggregate) error + func (s UserServiceImpl) ProjectUser(ctx context.Context, userAggregate *UserAggregate) error + func (s UserServiceImpl) SetRoles(ctx context.Context, command UserSetRolesComand, agent string) (UserSetRolesResponse, error) + func (s UserServiceImpl) UpdateUser(ctx context.Context, command UserUpdateCommand, agent string) (UserUpdatedResponse, error) + type UserSetRolesComand struct + Id int64 + RoleIds []int64 + type UserSetRolesResponse struct + type UserState struct + DisplayName string + Email string + FailedLoginAttempts int64 + FirstName string + LastLogin int64 + LastLoginAttempt int64 + LastName string + PasswordHash string + ResetToken *string + Roles []int64 + TwoFactorSharedSecret *string + type UserUpdateCommand struct + DisplayName *string + FirstName *string + Id int64 + LastName *string + Password *string + func (r UserUpdateCommand) Validate() *ubvalidation.ValidationIssues + type UserUpdatedResponse struct v0.0.2 Jun 24, 2025 v0.0.1 Jun 17, 2025