pass

package
v0.0.0-...-f1d979d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionReader

type PermissionReader struct {
	*eth.Eth
	// contains filtered or unexported fields
}

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

type PermissionWriter struct {
	*eth.Session
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL