Documentation ¶
Index ¶
- type PermissionReader
- func (r *PermissionReader) IsAllowedFactProvider(ctx context.Context, factProvider common.Address) (bool, error)
- func (r *PermissionReader) IsFactProviderInWhitelist(ctx context.Context, factProvider common.Address) (bool, error)
- func (r *PermissionReader) IsWhitelistOnlyPermissionSet(ctx context.Context) (bool, error)
- type PermissionWriter
- func (w *PermissionWriter) AddFactProviderToWhitelist(ctx context.Context, factProvider common.Address) (common.Hash, error)
- func (w *PermissionWriter) RemoveFactProviderFromWhitelist(ctx context.Context, factProvider common.Address) (common.Hash, error)
- func (w *PermissionWriter) SetWhitelistOnlyPermission(ctx context.Context, onlyWhitelist bool) (common.Hash, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermissionReader ¶
PermissionReader reads passport permissions. Anyone is allowed to read passport permissions.
func NewPermissionReader ¶
func NewPermissionReader(e *eth.Eth, passport common.Address) *PermissionReader
NewPermissionReader converts session to PermissionReader
func (*PermissionReader) IsAllowedFactProvider ¶
func (r *PermissionReader) IsAllowedFactProvider(ctx context.Context, factProvider common.Address) (bool, error)
IsAllowedFactProvider returns true when the given address is an allowed fact provider.
func (*PermissionReader) IsFactProviderInWhitelist ¶
func (r *PermissionReader) IsFactProviderInWhitelist(ctx context.Context, factProvider common.Address) (bool, error)
IsFactProviderInWhitelist returns true if fact provider is added to the whitelist.
func (*PermissionReader) IsWhitelistOnlyPermissionSet ¶
func (r *PermissionReader) IsWhitelistOnlyPermissionSet(ctx context.Context) (bool, error)
IsWhitelistOnlyPermissionSet returns true when a whitelist of fact providers is enabled.
type PermissionWriter ¶
PermissionWriter modifies passport permissions. Only passport owner is allowed to modify permissions.
func NewPermissionWriter ¶
func NewPermissionWriter(s *eth.Session, passport common.Address) *PermissionWriter
NewPermissionWriter converts session to PermissionWriter
func (*PermissionWriter) AddFactProviderToWhitelist ¶
func (w *PermissionWriter) AddFactProviderToWhitelist(ctx context.Context, factProvider common.Address) (common.Hash, error)
AddFactProviderToWhitelist allows owner to add fact provider to the whitelist.
func (*PermissionWriter) RemoveFactProviderFromWhitelist ¶
func (w *PermissionWriter) RemoveFactProviderFromWhitelist(ctx context.Context, factProvider common.Address) (common.Hash, error)
RemoveFactProviderFromWhitelist allows owner to remove fact provider from the whitelist.
func (*PermissionWriter) SetWhitelistOnlyPermission ¶
func (w *PermissionWriter) SetWhitelistOnlyPermission(ctx context.Context, onlyWhitelist bool) (common.Hash, error)
SetWhitelistOnlyPermission enables or disables the use of a whitelist of fact providers.