module
import "github.com/prescriptoo/prescriptoo-api/services/authorization/module"Package module composes the authorization service without exposing storage.
Index
- func NewAuthorizationService() types.IAuthorizationService
- type Capabilities
- type Module
- func NewModule(db *pgxpool.Pool, members p.MembershipReader, writer ...audit.TransactionalRecorderFactory) *Module
- func (m *Module) Administration() Capabilities
- func (m *Module) Authorization() types.IAuthorizationService
- func (m *Module) ConfigureSubscriptions(service sub.SubscriptionService, transactions sub.TransactionServices, organizations org.BillingOrganizations, enforce bool)
- func (m *Module) PermissionTransactions() p.OrganizationPermissionTransactions
- func (m *Module) Permissions() interface { p.OrganizationPermissionChecker p.AdminPermissionChecker }
func NewAuthorizationService
func NewAuthorizationService() types.IAuthorizationServiceNewAuthorizationService creates the shared authorization service placeholder.
type Capabilities
Capabilities are independently injectable into the owning HTTP services.
type Capabilities struct {
ListPermissions p.PermissionLister
ListRoles p.RoleLister
GetRole p.RoleReader
CreateRole p.RoleCreator
UpdateRole p.RoleEditor
DeleteRole p.RoleDeleter
SetRolePermissions p.RolePermissionSetter
GetMemberAuthorization p.MemberAuthorizationReader
AssignRole p.RoleAssigner
RevokeRole p.RoleRevoker
SetMemberPermission p.MemberPermissionSetter
RemoveMemberPermission p.MemberPermissionRemover
}2
3
4
5
6
7
8
9
10
11
12
13
14
type Module
Module holds the composed authorization application service.
type Module struct {
// contains filtered or unexported fields
}2
3
func NewModule
func NewModule(db *pgxpool.Pool, members p.MembershipReader, writer ...audit.TransactionalRecorderFactory) *ModuleNewModule constructs PostgreSQL-backed authorization capabilities.
func (*Module) Administration
func (m *Module) Administration() CapabilitiesAdministration exposes independently injectable authorization management capabilities.
func (*Module) Authorization
func (m *Module) Authorization() types.IAuthorizationServiceAuthorization returns the shared service placeholder, which currently allows all checks.
func (*Module) ConfigureSubscriptions
func (m *Module) ConfigureSubscriptions(service sub.SubscriptionService, transactions sub.TransactionServices, organizations org.BillingOrganizations, enforce bool)ConfigureSubscriptions adds organization-side write eligibility; platform scope is exempt.
func (*Module) PermissionTransactions
func (m *Module) PermissionTransactions() p.OrganizationPermissionTransactionsPermissionTransactions exposes current grant reads bound to a business transaction.
func (*Module) Permissions
func (m *Module) Permissions() interface {
p.OrganizationPermissionChecker
p.AdminPermissionChecker
}2
3
4
Permissions exposes narrow organization and platform permission checkers.
Generated by gomarkdoc