owner

package
v0.0.0-...-8fe6f98 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package owner provides method for storing in chaincode state information about chaincode owner

Index

Constants

View Source
const OwnerStateKey = `OWNER`

OwnerStateKey key used to store owner grant struct in chain code state

Variables

View Source
var (
	// ErrOwnerOnly error occurs when trying to invoke chaincode func  protected by onlyOwner middleware (modifier)
	ErrOwnerOnly = errors.New(`owner only`)
)
View Source
var (
	// ErrToMuchArguments occurs when to much arguments passed to Init
	ErrToMuchArguments = errors.New(`too much arguments`)
)

Functions

func FromState

func FromState(c router.Context) (interface{}, error)

FromState returns raw data ( serialized Grant ) of current chain code owner

func IdentityEntryFromState

func IdentityEntryFromState(c r.Context) (interface{}, error)

IdentityFromState

func IsInvoker

func IsInvoker(c r.Context) (bool, error)

IsInvoker checks than tx creator is chain code owner

func IsInvokerOr

func IsInvokerOr(c r.Context, allowedTo ...identity.Identity) (bool, error)

IsInvokerOr checks tx creator and compares with owner of another identity

func Only

func Only(next router.HandlerFunc, pos ...int) router.HandlerFunc

Only allow access from chain code owner

func SetFromCreator

func SetFromCreator(c r.Context) peer.Response

SetFromCreator sets chain code owner from stub creator

Types

This section is empty.

Jump to

Keyboard shortcuts

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