Documentation
¶
Index ¶
Constants ¶
View Source
const ( // OPTOUT_EMITTER defines if the emitter is granted/required for the opt-out operation OPTOUT_EMITTER = model.Bits8(1 << iota) // OPTOUT_BENEFICIARY defines if the beneficiary is granted/required for the opt-out operation OPTOUT_BENEFICIARY // FEEDING_EMITTER defines if the emitter is granted/required for the feeding operation FEEDING_EMITTER // FEEDING_BENEFICIARY defines if the beneficiary is granted/required for the feeding operation FEEDING_BENEFICIARY // SPENDING_EMITTER defines if the emitter is granted/required for the spending operation SPENDING_EMITTER // SPENDING_BENEFICIARY defines if the beneficiary is granted/required for the spending operation SPENDING_BENEFICIARY // OBLIVION_EMITTER defines if the emitter is granted/required for the oblivion operation OBLIVION_EMITTER // OBLIVION_BENEFICIARY defines if the beneficiary is granted/required for the oblivion operation OBLIVION_BENEFICIARY )
--- Flags for permissions
View Source
const ( // BENEFICIARY_ONLY states that the beneficiary is required and only him, ie. permissions for an operation should be in the form "10". BENEFICIARY_ONLY = Stakeholder(iota) // EMITTER_ONLY states that the emitter is required and only him, ie. permissions for an operation should be in the form "01". EMITTER_ONLY // AT_LEAST_ONE_STAKEHOLDER states that at least one stakeholder is required, no matter whom, ie. permissions for an operation should be in the form "01" or "10". AT_LEAST_ONE_STAKEHOLDER // BOTH_STAKEHOLDERS states that both stakeholders are required, ie. permissions for an operation should be in the form "11". BOTH_STAKEHOLDERS // ANY_STAKEHOLDER states that no stakeholder is actually required, ie. any stakeholder can perform the operation, therefore permissions for this operation could be in any form (including "00"). ANY_STAKEHOLDER )
Variables ¶
View Source
var DEFAULT, _ = StringToPermissions("00100100")
DEFAULT is the default permissions to set in transactions
Functions ¶
This section is empty.
Types ¶
type Permissions ¶
Permissions ...
func StringToPermissions ¶
func StringToPermissions(str string) (p Permissions, err error)
StringToPermissions ...
func (*Permissions) Requires ¶
func (p *Permissions) Requires(s Stakeholder, on operation.Operation) bool
Requires ...
type Requirements ¶
Requirements ...
func RequirementsFor ¶
func RequirementsFor(op operation.Operation) (Requirements, error)
RequirementsFor returns the Requirements for the passed operation, or an error if any.
Click to show internal directories.
Click to hide internal directories.