acl

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoRights       = "you have no right to make '%s' operation with chaincode '%s' with role '%s'"
	EmptyResponse  = "ACL empty response"
	WrongArgsCount = "wrong arguments count, get: %d, want: %d"
)

acl errors

View Source
const (
	GetAccOpRightArgCount   = 5
	GetAccAllRightsArgCount = 5
	AddRightsArgsCount      = 5
	RemoveRightsArgsCount   = 5
)

access matrix functions args count

View Source
const (
	Ch = "acl"
	CC = "acl"
)

Ch - ACL channel name, CC - ACL chaincode name

View Source
const (
	GetAccOpRightFn   = "getAccountOperationRight"
	GetAccAllRightsFn = "getAccountAllRights"
	AddRightsFn       = "addRights"
	RemoveRightsFn    = "removeRights"
)

acl chaincode functions

Variables

This section is empty.

Functions

func GetAccountAllRights

func GetAccountAllRights(stub shim.ChaincodeStubInterface, params []string) (*pb.AccountRights, error)

GetAccountAllRights fetch all permissions, available for account, params[0] -> channel name params[1] -> chaincode name params[2] -> role params[3] -> operation name params[4] -> account address

func GetAccountRight

func GetAccountRight(stub shim.ChaincodeStubInterface, params []string) (*pb.HaveRight, error)

GetAccountRight checks permission for user doing operation with chaincode in channel with role params[0] -> channel name params[1] -> chaincode name params[2] -> role params[3] -> operation name params[4] -> user address

func GetOperationAllRights

func GetOperationAllRights(stub shim.ChaincodeStubInterface, params []string) (*pb.AccountRights, error)

GetOperationAllRights fetch all permissions for user with chaincode in channel with specified role params[0] -> channel name params[1] -> chaincode name params[2] -> role params[3] -> operation name params[4] -> user address

Types

type Role

type Role string

Role is the role of the user

const (
	// Issuer is the issuer role
	Issuer Role = "issuer"
	// FeeSetter is the fee setter role
	FeeSetter Role = "feeSetter"
)

func (Role) String

func (r Role) String() string

String returns the string representation of the role

Jump to

Keyboard shortcuts

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