keeper

package
v0.2.3-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,

	accountKeeper types.AccountKeeper,
	authority string,
) *Keeper

func (Keeper) AddGroupMember

func (k Keeper) AddGroupMember(ctx sdk.Context, groupID math.Uint, member sdk.AccAddress) error

func (Keeper) DeletePolicy

func (k Keeper) DeletePolicy(ctx sdk.Context, principal *types.Principal, resourceType resource.ResourceType,
	resourceID math.Uint) (math.Uint, error)

func (Keeper) ExistAccountPolicyForResource added in v0.2.0

func (k Keeper) ExistAccountPolicyForResource(ctx sdk.Context, resourceType resource.ResourceType, resourceID math.Uint) bool

func (Keeper) ExistGroupMemberForGroup added in v0.2.0

func (k Keeper) ExistGroupMemberForGroup(ctx sdk.Context, groupId math.Uint) bool

func (Keeper) ExistGroupPolicyForResource added in v0.2.0

func (k Keeper) ExistGroupPolicyForResource(ctx sdk.Context, resourceType resource.ResourceType, resourceID math.Uint) bool

func (Keeper) ForceDeleteAccountPolicyForResource added in v0.2.0

func (k Keeper) ForceDeleteAccountPolicyForResource(ctx sdk.Context, maxDelete, deletedTotal uint64, resourceType resource.ResourceType, resourceID math.Uint) (uint64, bool)

ForceDeleteAccountPolicyForResource deletes all individual accounts policy enforced on resources, if

func (Keeper) ForceDeleteGroupMembers added in v0.2.0

func (k Keeper) ForceDeleteGroupMembers(ctx sdk.Context, maxDelete, deletedTotal uint64, groupId math.Uint) (uint64, bool)

ForceDeleteGroupMembers deletes group members when user deletes a group

func (Keeper) ForceDeleteGroupPolicyForResource added in v0.2.0

func (k Keeper) ForceDeleteGroupPolicyForResource(ctx sdk.Context, maxDelete, deletedTotal uint64, resourceType resource.ResourceType, resourceID math.Uint) (uint64, bool)

ForceDeleteGroupPolicyForResource deletes group policy enforced on resource

func (Keeper) GetAuthority added in v0.2.0

func (k Keeper) GetAuthority() string

func (Keeper) GetGroupMember added in v0.0.10

func (k Keeper) GetGroupMember(ctx sdk.Context, groupID math.Uint, member sdk.AccAddress) (*types.GroupMember, bool)

func (Keeper) GetGroupMemberByID added in v0.0.10

func (k Keeper) GetGroupMemberByID(ctx sdk.Context, groupMemberID math.Uint) (*types.GroupMember, bool)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)

GetParams returns the current permission module parameters.

func (Keeper) GetPolicyByID

func (k Keeper) GetPolicyByID(ctx sdk.Context, policyID math.Uint) (*types.Policy, bool)

func (Keeper) GetPolicyForAccount added in v0.0.8

func (k Keeper) GetPolicyForAccount(ctx sdk.Context, resourceID math.Uint,
	resourceType resource.ResourceType, addr sdk.AccAddress) (policy *types.Policy,
	isFound bool)

func (Keeper) GetPolicyForGroup added in v0.0.8

func (k Keeper) GetPolicyForGroup(ctx sdk.Context, resourceID math.Uint,
	resourceType resource.ResourceType, groupID math.Uint) (policy *types.Policy,
	isFound bool)

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) MaximumPolicyGroupSize added in v0.0.10

func (k Keeper) MaximumPolicyGroupSize(ctx sdk.Context) (res uint64)

func (Keeper) MaximumStatementsNum

func (k Keeper) MaximumStatementsNum(ctx sdk.Context) (res uint64)

func (Keeper) MustGetPolicyByID

func (k Keeper) MustGetPolicyByID(ctx sdk.Context, policyID math.Uint) *types.Policy

func (Keeper) Params

func (Keeper) PutPolicy

func (k Keeper) PutPolicy(ctx sdk.Context, policy *types.Policy) (math.Uint, error)

func (Keeper) RemoveGroupMember

func (k Keeper) RemoveGroupMember(ctx sdk.Context, groupID math.Uint, member sdk.AccAddress) error

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the params of permission module

func (Keeper) VerifyPolicy

func (k Keeper) VerifyPolicy(ctx sdk.Context, resourceID math.Uint, resourceType resource.ResourceType,
	operator sdk.AccAddress, action types.ActionType, opts *types.VerifyOptions) types.Effect

Jump to

Keyboard shortcuts

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