Skip to content

module ​

go
import "github.com/prescriptoo/prescriptoo-api/services/authorization/module"

Package module composes the authorization service without exposing storage.

Index ​

func NewAuthorizationService ​

go
func NewAuthorizationService() types.IAuthorizationService

NewAuthorizationService creates the shared authorization service placeholder.

type Capabilities ​

Capabilities are independently injectable into the owning HTTP services.

go
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
}

type Module ​

Module holds the composed authorization application service.

go
type Module struct {
    // contains filtered or unexported fields
}

func NewModule ​

go
func NewModule(db *pgxpool.Pool, members p.MembershipReader, writer ...audit.TransactionalRecorderFactory) *Module

NewModule constructs PostgreSQL-backed authorization capabilities.

func (*Module) Administration ​

go
func (m *Module) Administration() Capabilities

Administration exposes independently injectable authorization management capabilities.

func (*Module) Authorization ​

go
func (m *Module) Authorization() types.IAuthorizationService

Authorization returns the shared service placeholder, which currently allows all checks.

func (*Module) ConfigureSubscriptions ​

go
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 ​

go
func (m *Module) PermissionTransactions() p.OrganizationPermissionTransactions

PermissionTransactions exposes current grant reads bound to a business transaction.

func (*Module) Permissions ​

go
func (m *Module) Permissions() interface {
    p.OrganizationPermissionChecker
    p.AdminPermissionChecker
}

Permissions exposes narrow organization and platform permission checkers.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.