Versions in this module Expand all Collapse all v1 v1.0.0 Mar 21, 2026 Changes in this version + type RolePermissionUseCase struct + func NewRolePermissionUseCase(service *services.RolePermissionService) RolePermissionUseCase + func (u RolePermissionUseCase) AddPermissionToRole(ctx context.Context, roleID string, permissionID string, ...) error + func (u RolePermissionUseCase) AssignRoleToUser(ctx context.Context, userID string, req types.AssignUserRoleRequest, ...) error + func (u RolePermissionUseCase) CreatePermission(ctx context.Context, req types.CreatePermissionRequest) (*types.Permission, error) + func (u RolePermissionUseCase) CreateRole(ctx context.Context, req types.CreateRoleRequest) (*types.Role, error) + func (u RolePermissionUseCase) DeletePermission(ctx context.Context, permissionID string) error + func (u RolePermissionUseCase) DeleteRole(ctx context.Context, roleID string) error + func (u RolePermissionUseCase) GetAllPermissions(ctx context.Context) ([]types.Permission, error) + func (u RolePermissionUseCase) GetAllRoles(ctx context.Context) ([]types.Role, error) + func (u RolePermissionUseCase) GetRoleByID(ctx context.Context, roleID string) (*types.RoleDetails, error) + func (u RolePermissionUseCase) GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error) + func (u RolePermissionUseCase) RemovePermissionFromRole(ctx context.Context, roleID string, permissionID string) error + func (u RolePermissionUseCase) RemoveRoleFromUser(ctx context.Context, userID string, roleID string) error + func (u RolePermissionUseCase) ReplaceRolePermissions(ctx context.Context, roleID string, permissionIDs []string, ...) error + func (u RolePermissionUseCase) ReplaceUserRoles(ctx context.Context, userID string, roleIDs []string, assignedByUserID *string) error + func (u RolePermissionUseCase) UpdatePermission(ctx context.Context, permissionID string, req types.UpdatePermissionRequest) (*types.Permission, error) + func (u RolePermissionUseCase) UpdateRole(ctx context.Context, roleID string, req types.UpdateRoleRequest) (*types.Role, error) + type UseCases struct + func NewAccessControlUseCases(rolePermission RolePermissionUseCase, userAccess UserRolesUseCase) *UseCases + func (u *UseCases) AddPermissionToRole(ctx context.Context, roleID string, permissionID string, ...) error + func (u *UseCases) AssignRoleToUser(ctx context.Context, userID string, req types.AssignUserRoleRequest, ...) error + func (u *UseCases) CreatePermission(ctx context.Context, req types.CreatePermissionRequest) (*types.Permission, error) + func (u *UseCases) CreateRole(ctx context.Context, req types.CreateRoleRequest) (*types.Role, error) + func (u *UseCases) DeletePermission(ctx context.Context, permissionID string) error + func (u *UseCases) DeleteRole(ctx context.Context, roleID string) error + func (u *UseCases) GetAllPermissions(ctx context.Context) ([]types.Permission, error) + func (u *UseCases) GetAllRoles(ctx context.Context) ([]types.Role, error) + func (u *UseCases) GetRoleByID(ctx context.Context, roleID string) (*types.RoleDetails, error) + func (u *UseCases) GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error) + func (u *UseCases) GetUserAuthorizationProfile(ctx context.Context, userID string) (*types.UserAuthorizationProfile, error) + func (u *UseCases) GetUserEffectivePermissions(ctx context.Context, userID string) ([]types.UserPermissionInfo, error) + func (u *UseCases) GetUserRoles(ctx context.Context, userID string) ([]types.UserRoleInfo, error) + func (u *UseCases) GetUserWithPermissionsByID(ctx context.Context, userID string) (*types.UserWithPermissions, error) + func (u *UseCases) GetUserWithRolesByID(ctx context.Context, userID string) (*types.UserWithRoles, error) + func (u *UseCases) HasPermissions(ctx context.Context, userID string, requiredPermissions []string) (bool, error) + func (u *UseCases) RemovePermissionFromRole(ctx context.Context, roleID string, permissionID string) error + func (u *UseCases) RemoveRoleFromUser(ctx context.Context, userID string, roleID string) error + func (u *UseCases) ReplaceRolePermissions(ctx context.Context, roleID string, permissionIDs []string, ...) error + func (u *UseCases) ReplaceUserRoles(ctx context.Context, userID string, roleIDs []string, assignedByUserID *string) error + func (u *UseCases) RolePermissionUseCase() RolePermissionUseCase + func (u *UseCases) UpdatePermission(ctx context.Context, permissionID string, req types.UpdatePermissionRequest) (*types.Permission, error) + func (u *UseCases) UpdateRole(ctx context.Context, roleID string, req types.UpdateRoleRequest) (*types.Role, error) + func (u *UseCases) UserAccessUseCase() UserRolesUseCase + type UserRolesUseCase struct + func NewUserRolesUseCase(service *services.UserAccessService) UserRolesUseCase + func (u UserRolesUseCase) GetUserAuthorizationProfile(ctx context.Context, userID string) (*types.UserAuthorizationProfile, error) + func (u UserRolesUseCase) GetUserEffectivePermissions(ctx context.Context, userID string) ([]types.UserPermissionInfo, error) + func (u UserRolesUseCase) GetUserRoles(ctx context.Context, userID string) ([]types.UserRoleInfo, error) + func (u UserRolesUseCase) GetUserWithPermissionsByID(ctx context.Context, userID string) (*types.UserWithPermissions, error) + func (u UserRolesUseCase) GetUserWithRolesByID(ctx context.Context, userID string) (*types.UserWithRoles, error) + func (u UserRolesUseCase) HasPermissions(ctx context.Context, userID string, requiredPermissions []string) (bool, error)