acl

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ArgsQtyGetAccOpRight                 = 5
	ArgsQtyAddRights                     = 5
	ArgsQtyRemoveRights                  = 5
	ArgsQtyAddAddressRightForNominee     = 4
	ArgsQtyRemoveAddressRightFromNominee = 4
	ArgsQtyGetAddressRightForNominee     = 4
	ArgsQtyGetAddressesListForNominee    = 3
)

access matrix functions args count

View Source
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

View Source
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

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 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

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