acl

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GetAccOpRightArgCount = 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"
	AddRightsFn     = "addRights"
	RemoveRightsFn  = "removeRights"
)

acl chaincode functions

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

acl errors

Variables

This section is empty.

Functions

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 IsIssuerAccountRight

func IsIssuerAccountRight(bci core.BaseContractInterface, address *types.Address) (bool, error)

IsIssuerAccountRight checks whether the specified address holds the Issuer right by querying ACL account rights. It utilizes the provided BaseContractInterface (bci) to interact with the smart contract. The function returns a boolean indicating if the address is an issuer and an error if encountered.

Parameters:

  • bci: The BaseContractInterface representing the smart contract interface.
  • address: A pointer to the Address being checked for issuer rights.

Returns:

  • bool: True if the address is an issuer, false otherwise.
  • error: Any error encountered during the process, or nil if successful.

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