keeper

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLimit = 100

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the perm MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier creates a querier for perm REST endpoints

Types

type AuthDecorator

type AuthDecorator struct {
	// contains filtered or unexported fields
}

func NewAuthDecorator

func NewAuthDecorator(k Keeper) AuthDecorator

func (AuthDecorator) AnteHandle

func (ad AuthDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle returns an AnteHandler that checks the auth to send msg

type Keeper

type Keeper struct {
	AuthMap map[string]types.Auth
	// contains filtered or unexported fields
}

keeper of the perm store

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey) Keeper

func (Keeper) Access

func (k Keeper) Access(ctx sdk.Context, signer sdk.AccAddress, auth types.Auth) error

Access checks the signer auth

func (Keeper) AccountBlockList

AccountBlockList queries all blocked accounts

func (*Keeper) Authorize

func (k *Keeper) Authorize(ctx sdk.Context, address, operator sdk.AccAddress, rs ...types.Role) error

Authorize assigns the specified roles to an address

func (Keeper) Block

func (k Keeper) Block(ctx sdk.Context, address sdk.AccAddress) error

Block blocks an account

func (Keeper) BlockContract

func (k Keeper) BlockContract(ctx sdk.Context, contractAddress string) error

BlockContract blocks a contract

func (Keeper) ContractDenyList

ContractDenyList queries all blocked contract

func (Keeper) DeleteAuth

func (k Keeper) DeleteAuth(ctx sdk.Context, address sdk.AccAddress)

DeleteAuth deletes the auth for an address

func (Keeper) GetAllBlockAccounts

func (k Keeper) GetAllBlockAccounts(ctx sdk.Context) (accounts []string)

GetAllBlockAccounts gets the set of all accounts with no limits, used durng genesis dump

func (Keeper) GetAuth

func (k Keeper) GetAuth(ctx sdk.Context, address sdk.AccAddress) types.Auth

GetAuth gets the auth for an address

func (Keeper) GetBlockAccount

func (k Keeper) GetBlockAccount(ctx sdk.Context, address sdk.AccAddress) bool

GetBlockAccount return an account blocked

func (Keeper) GetBlockContract

func (k Keeper) GetBlockContract(ctx sdk.Context, address []byte) bool

GetBlockContract return a contract blocked

func (Keeper) GetContractDenyList

func (k Keeper) GetContractDenyList(ctx sdk.Context) (accounts []string)

GetContractDenyList gets the set of all contract with no limits, used durng genesis dump

func (Keeper) GetRoles

func (k Keeper) GetRoles(ctx sdk.Context) (roleAccounts []types.RoleAccount)

GetRoles gets the role set for all accounts

func (Keeper) IsAdmin

func (k Keeper) IsAdmin(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsAdminPerm

func (k Keeper) IsAdminPerm(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsBaseM1Admin

func (k Keeper) IsBaseM1Admin(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsPermAdmin

func (k Keeper) IsPermAdmin(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsPlatformUser

func (k Keeper) IsPlatformUser(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsPowerAdminPerm

func (k Keeper) IsPowerAdminPerm(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsPowerUserAdmin

func (k Keeper) IsPowerUserAdmin(ctx sdk.Context, address sdk.AccAddress) bool

func (Keeper) IsRootAdmin

func (k Keeper) IsRootAdmin(ctx sdk.Context, address sdk.AccAddress) bool

func (*Keeper) RegisterModuleAuth

func (k *Keeper) RegisterModuleAuth(module string, roles ...types.Role)

RegisterModuleAuth registers the auth to send the module related msgs. Each role gets the access control

func (Keeper) RegisterMsgAuth

func (k Keeper) RegisterMsgAuth(msg sdk.Msg, roles ...types.Role)

RegisterMsgAuth registers the auth to send the msg. Each role gets the access control

func (Keeper) Roles

Roles queries roles of a given address

func (Keeper) SetAuth

func (k Keeper) SetAuth(ctx sdk.Context, address sdk.AccAddress, auth types.Auth)

SetAuth sets the auth for an address

func (Keeper) Unauthorize

func (k Keeper) Unauthorize(ctx sdk.Context, address, operator sdk.AccAddress, roles ...types.Role) error

Unauthorize unassigns the specified roles from an address

func (Keeper) Unblock

func (k Keeper) Unblock(ctx sdk.Context, address sdk.AccAddress) error

Unblock unblocks an account

func (Keeper) UnblockContract

func (k Keeper) UnblockContract(ctx sdk.Context, contractAddress string) error

UnblockContract unblocks a contract

Jump to

Keyboard shortcuts

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