Documentation
¶
Index ¶
- Constants
- func GetAccountRight(stub shim.ChaincodeStubInterface, params []string) (*pb.HaveRight, error)
- func GetAddressRightForNominee(stub shim.ChaincodeStubInterface, params []string) (*pb.HaveRight, error)
- func GetAddressesListForNominee(stub shim.ChaincodeStubInterface, params []string) (*pb.Accounts, error)
- func IsIssuerAccountRight(bci core.BaseContractInterface, address *types.Address) (bool, error)
- type Role
Constants ¶
const ( ArgsQtyGetAccOpRight = 5 ArgsQtyAddRights = 5 ArgsQtyRemoveRights = 5 ArgsQtyAddAddressRightForNominee = 4 ArgsQtyRemoveAddressRightFromNominee = 4 ArgsQtyGetAddressRightForNominee = 4 ArgsQtyGetAddressesListForNominee = 3 )
access matrix functions args count
const ( FnCheckAddress = "checkAddress" FnCheckKeys = "checkKeys" FnGetAccountInfo = "getAccountInfo" FnGetAccountsInfo = "getAccountsInfo" FnGetAccOpRight = "getAccountOperationRight" FnAddRights = "addRights" FnRemoveRights = "removeRights" FnAddAddressRightForNominee = "addAddressRightForNominee" FnRemoveAddressRightFromNominee = "removeAddressRightFromNominee" FnGetAddressRightForNominee = "getAddressRightForNominee" FnGetAddressesListForNominee = "getAddressesListForNominee" )
acl chaincode functions
const (
// NoRights = "you have no right to make '%s' operation with chaincode '%s' with role '%s'"
ErrWrongArgsCount = "wrong arguments count, get: %d, want: %d"
)
acl errors
Variables ¶
This section is empty.
Functions ¶
func GetAccountRight ¶
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 GetAddressRightForNominee ¶ added in v0.0.8
func GetAddressRightForNominee(stub shim.ChaincodeStubInterface, params []string) (*pb.HaveRight, error)
GetAddressRightForNominee returns if nominee have right to transfer from specified address args[0] - channelName args[1] - chaincodeName args[2] - nomineeAddress args[3] - principalAddress
func GetAddressesListForNominee ¶ added in v0.0.8
func GetAddressesListForNominee(stub shim.ChaincodeStubInterface, params []string) (*pb.Accounts, error)
GetAddressesListForNominee returns principal addresses for nominee args[0] - channelName args[1] - chaincodeName args[2] - nomineeAddress
func IsIssuerAccountRight ¶
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.