Documentation ¶
Overview ¶
Package owner provides method for storing in chaincode state information about chaincode owner
Index ¶
- Constants
- Variables
- func FromState(c router.Context) (interface{}, error)
- func IdentityEntryFromState(c r.Context) (interface{}, error)
- func IsInvoker(c r.Context) (bool, error)
- func IsInvokerOr(c r.Context, allowedTo ...identity.Identity) (bool, error)
- func Only(next router.HandlerFunc, pos ...int) router.HandlerFunc
- func SetFromCreator(c r.Context) peer.Response
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 IdentityEntryFromState ¶
IdentityFromState
func IsInvokerOr ¶
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.