Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidSubspacesInvariant(k Keeper) sdk.Invariant
- func ValidUserGroupsInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AddUserToGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress) error
- func (k Keeper) AfterSubspaceDeleted(ctx sdk.Context, subspaceID uint64)
- func (k Keeper) AfterSubspaceGroupDeleted(ctx sdk.Context, subspaceID uint64, groupID uint32)
- func (k Keeper) AfterSubspaceGroupMemberAdded(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
- func (k Keeper) AfterSubspaceGroupMemberRemoved(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
- func (k Keeper) AfterSubspaceGroupSaved(ctx sdk.Context, subspaceID uint64, groupID uint32)
- func (k Keeper) AfterSubspaceSaved(ctx sdk.Context, subspaceID uint64)
- func (k Keeper) AfterUserPermissionRemoved(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress)
- func (k Keeper) AfterUserPermissionSet(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, ...)
- func (k Keeper) DeleteSubspace(ctx sdk.Context, subspaceID uint64)
- func (k Keeper) DeleteUserGroup(ctx sdk.Context, subspaceID uint64, groupID uint32)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllPermissions(ctx sdk.Context) []types.ACLEntry
- func (k Keeper) GetAllSubspaces(ctx sdk.Context) []types.Subspace
- func (k Keeper) GetAllUserGroups(ctx sdk.Context) []types.UserGroup
- func (k Keeper) GetGenesisSubspaces(ctx sdk.Context, subspaces []types.Subspace) []types.GenesisSubspace
- func (k Keeper) GetGroupID(ctx sdk.Context, subspaceID uint64) (groupID uint32, err error)
- func (k Keeper) GetGroupMembers(ctx sdk.Context, subspaceID uint64, groupID uint32) []sdk.AccAddress
- func (k Keeper) GetGroupsInheritedPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress) types.Permission
- func (k Keeper) GetSubspace(ctx sdk.Context, subspaceID uint64) (subspace types.Subspace, found bool)
- func (k Keeper) GetSubspaceGroups(ctx sdk.Context, subspaceID uint64) []types.UserGroup
- func (k Keeper) GetSubspaceID(ctx sdk.Context) (subspaceID uint64, err error)
- func (k Keeper) GetUserAllGroupsMembers(ctx sdk.Context) []types.UserGroupMembersEntry
- func (k Keeper) GetUserGroup(ctx sdk.Context, subspaceID uint64, groupID uint32) (group types.UserGroup, found bool)
- func (k Keeper) GetUserPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress) types.Permission
- func (k Keeper) GetUsersWithPermission(ctx sdk.Context, subspaceID uint64, permission types.Permission) ([]sdk.AccAddress, error)
- func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, ...) bool
- func (k Keeper) HasSubspace(ctx sdk.Context, subspaceID uint64) bool
- func (k Keeper) HasUserGroup(ctx sdk.Context, subspaceID uint64, groupID uint32) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IsMemberOfGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress) bool
- func (k Keeper) IterateGroupMembers(ctx sdk.Context, subspaceID uint64, groupID uint32, ...)
- func (k Keeper) IterateSubspaceGroups(ctx sdk.Context, subspaceID uint64, ...)
- func (k Keeper) IterateSubspacePermissions(ctx sdk.Context, subspaceID uint64, ...)
- func (k Keeper) IterateSubspaces(ctx sdk.Context, fn func(index int64, subspace types.Subspace) (stop bool))
- func (k Keeper) IterateUserGroups(ctx sdk.Context, fn func(index int64, group types.UserGroup) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RemoveUserFromGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
- func (k Keeper) RemoveUserPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress)
- func (k Keeper) SaveSubspace(ctx sdk.Context, subspace types.Subspace)
- func (k Keeper) SaveUserGroup(ctx sdk.Context, group types.UserGroup)
- func (k Keeper) SetGroupID(ctx sdk.Context, subspaceID uint64, groupID uint32)
- func (k *Keeper) SetHooks(sh types.SubspacesHooks) *Keeper
- func (k Keeper) SetSubspaceID(ctx sdk.Context, subspaceID uint64)
- func (k Keeper) SetUserPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, ...)
- func (k Keeper) Subspace(ctx context.Context, request *types.QuerySubspaceRequest) (*types.QuerySubspaceResponse, error)
- func (k Keeper) Subspaces(ctx context.Context, request *types.QuerySubspacesRequest) (*types.QuerySubspacesResponse, error)
- func (k Keeper) UserGroup(ctx context.Context, request *types.QueryUserGroupRequest) (*types.QueryUserGroupResponse, error)
- func (k Keeper) UserGroupMembers(ctx context.Context, request *types.QueryUserGroupMembersRequest) (*types.QueryUserGroupMembersResponse, error)
- func (k Keeper) UserGroups(ctx context.Context, request *types.QueryUserGroupsRequest) (*types.QueryUserGroupsResponse, error)
- func (k Keeper) UserPermissions(ctx context.Context, request *types.QueryUserPermissionsRequest) (*types.QueryUserPermissionsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the stored MsgServer interface for the provided keeper
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all subspaces invariants
func ValidSubspacesInvariant ¶
ValidSubspacesInvariant checks that all the subspaces are valid
func ValidUserGroupsInvariant ¶
ValidUserGroupsInvariant checks that all the subspaces are valid
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey) Keeper
NewKeeper creates new instances of the subspaces keeper
func (Keeper) AddUserToGroup ¶
func (k Keeper) AddUserToGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress) error
AddUserToGroup adds the given user to the group having the provided id inside the specified subspace. If the group does not exist inside the subspace, it returns an error.
func (Keeper) AfterSubspaceDeleted ¶
AfterSubspaceDeleted - call if hook is registered
func (Keeper) AfterSubspaceGroupDeleted ¶
AfterSubspaceGroupDeleted - call if hook is registered
func (Keeper) AfterSubspaceGroupMemberAdded ¶
func (k Keeper) AfterSubspaceGroupMemberAdded(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
AfterSubspaceGroupMemberAdded - call if hook is registered
func (Keeper) AfterSubspaceGroupMemberRemoved ¶
func (k Keeper) AfterSubspaceGroupMemberRemoved(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
AfterSubspaceGroupMemberRemoved - call if hook is registered
func (Keeper) AfterSubspaceGroupSaved ¶
AfterSubspaceGroupSaved - call if hook is registered
func (Keeper) AfterSubspaceSaved ¶
AfterSubspaceSaved - call if hook is registered
func (Keeper) AfterUserPermissionRemoved ¶
AfterUserPermissionRemoved - call if hook is registered
func (Keeper) AfterUserPermissionSet ¶
func (k Keeper) AfterUserPermissionSet(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, permissions types.Permission)
AfterUserPermissionSet - call if hook is registered
func (Keeper) DeleteSubspace ¶
DeleteSubspace allows to delete the subspace with the given id
func (Keeper) DeleteUserGroup ¶
DeleteUserGroup deletes the group with the given id from the subspace with the provided id
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the GenesisState associated with the given context
func (Keeper) GetAllPermissions ¶
GetAllPermissions returns all the stored permissions for all subspaces
func (Keeper) GetAllSubspaces ¶
GetAllSubspaces returns a list of all the subspaces that have been store inside the given context
func (Keeper) GetAllUserGroups ¶
GetAllUserGroups returns the information (name and members) for all the groups of all the subspaces
func (Keeper) GetGenesisSubspaces ¶
func (k Keeper) GetGenesisSubspaces(ctx sdk.Context, subspaces []types.Subspace) []types.GenesisSubspace
GetGenesisSubspaces maps the given subspaces to the corresponding GenesisSubspace instance
func (Keeper) GetGroupID ¶
GetGroupID gets the highest group id for the subspace with the given id
func (Keeper) GetGroupMembers ¶
func (k Keeper) GetGroupMembers(ctx sdk.Context, subspaceID uint64, groupID uint32) []sdk.AccAddress
GetGroupMembers iterates returns all the members of a group inside a specific subspace
func (Keeper) GetGroupsInheritedPermissions ¶
func (k Keeper) GetGroupsInheritedPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress) types.Permission
GetGroupsInheritedPermissions returns the permissions that the specified user has inherited from all the groups that they are part of.
func (Keeper) GetSubspace ¶
func (k Keeper) GetSubspace(ctx sdk.Context, subspaceID uint64) (subspace types.Subspace, found bool)
GetSubspace returns the subspace associated with the given id. If there is no subspace associated with the given id the function will return an empty subspace and false.
func (Keeper) GetSubspaceGroups ¶
GetSubspaceGroups returns the list of all groups present inside a given subspace
func (Keeper) GetSubspaceID ¶
GetSubspaceID gets the highest subspace id
func (Keeper) GetUserAllGroupsMembers ¶
func (k Keeper) GetUserAllGroupsMembers(ctx sdk.Context) []types.UserGroupMembersEntry
GetUserAllGroupsMembers returns all the UserGroupMembersEntry
func (Keeper) GetUserGroup ¶
func (k Keeper) GetUserGroup(ctx sdk.Context, subspaceID uint64, groupID uint32) (group types.UserGroup, found bool)
GetUserGroup returns the group associated with the given id inside the subspace with the provided id. If there is no group associated with the given id the function will return an empty group and false.
func (Keeper) GetUserPermissions ¶
func (k Keeper) GetUserPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress) types.Permission
GetUserPermissions returns the permissions that are currently set inside the subspace with the given id for the given user
func (Keeper) GetUsersWithPermission ¶
func (k Keeper) GetUsersWithPermission(ctx sdk.Context, subspaceID uint64, permission types.Permission) ([]sdk.AccAddress, error)
GetUsersWithPermission returns all the users that have a given permission inside the specified subspace
func (Keeper) HasPermission ¶
func (k Keeper) HasPermission(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, permission types.Permission) bool
HasPermission checks whether the specific user has the given permission inside a specific subspace
func (Keeper) HasSubspace ¶
HasSubspace tells whether the given subspace exists or not
func (Keeper) HasUserGroup ¶
HasUserGroup returns whether the given subspace has a group with the specified id or not
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis initializes the chain state based on the given GenesisState
func (Keeper) IsMemberOfGroup ¶
func (k Keeper) IsMemberOfGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress) bool
IsMemberOfGroup returns whether the given user is part of the group with the specified id inside the provided subspace
func (Keeper) IterateGroupMembers ¶
func (k Keeper) IterateGroupMembers( ctx sdk.Context, subspaceID uint64, groupID uint32, fn func(index int64, member sdk.AccAddress) (stop bool), )
IterateGroupMembers iterates over all the members of the group with the given name present inside the given subspace
func (Keeper) IterateSubspaceGroups ¶
func (k Keeper) IterateSubspaceGroups( ctx sdk.Context, subspaceID uint64, fn func(index int64, group types.UserGroup) (stop bool), )
IterateSubspaceGroups allows iterating over all the groups that are part of the subspace having the given id
func (Keeper) IterateSubspacePermissions ¶
func (k Keeper) IterateSubspacePermissions( ctx sdk.Context, subspaceID uint64, fn func(index int64, user sdk.AccAddress, permission types.Permission) (stop bool), )
IterateSubspacePermissions iterates over all the permissions set for the subspace with the given id
func (Keeper) IterateSubspaces ¶
func (k Keeper) IterateSubspaces(ctx sdk.Context, fn func(index int64, subspace types.Subspace) (stop bool))
IterateSubspaces iterates through the subspaces set and performs the given function
func (Keeper) IterateUserGroups ¶
func (k Keeper) IterateUserGroups(ctx sdk.Context, fn func(index int64, group types.UserGroup) (stop bool))
IterateUserGroups iterates over all the users groups stored
func (Keeper) RemoveUserFromGroup ¶
func (k Keeper) RemoveUserFromGroup(ctx sdk.Context, subspaceID uint64, groupID uint32, user sdk.AccAddress)
RemoveUserFromGroup removes the specified user from the subspace group having the given id.
func (Keeper) RemoveUserPermissions ¶
RemoveUserPermissions removes the permission for the given user inside the provided subspace
func (Keeper) SaveSubspace ¶
SaveSubspace saves the given subspace inside the current context.
func (Keeper) SaveUserGroup ¶
SaveUserGroup saves within the subspace having the given id the provided group
func (Keeper) SetGroupID ¶
SetGroupID sets the new group id for the specific subspace to the store
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(sh types.SubspacesHooks) *Keeper
SetHooks allows to set the subspaces hooks
func (Keeper) SetSubspaceID ¶
SetSubspaceID sets the new subspace id to the store
func (Keeper) SetUserPermissions ¶
func (k Keeper) SetUserPermissions(ctx sdk.Context, subspaceID uint64, user sdk.AccAddress, permissions types.Permission)
SetUserPermissions sets the given permission for the specific user inside a single subspace
func (Keeper) Subspace ¶
func (k Keeper) Subspace(ctx context.Context, request *types.QuerySubspaceRequest) (*types.QuerySubspaceResponse, error)
Subspace implements the Query/Subspace gRPC method
func (Keeper) Subspaces ¶
func (k Keeper) Subspaces(ctx context.Context, request *types.QuerySubspacesRequest) (*types.QuerySubspacesResponse, error)
Subspaces implements the Query/Subspaces gRPC method
func (Keeper) UserGroup ¶
func (k Keeper) UserGroup(ctx context.Context, request *types.QueryUserGroupRequest) (*types.QueryUserGroupResponse, error)
UserGroup implements the Query/UserGroup gRPC method
func (Keeper) UserGroupMembers ¶
func (k Keeper) UserGroupMembers(ctx context.Context, request *types.QueryUserGroupMembersRequest) (*types.QueryUserGroupMembersResponse, error)
UserGroupMembers implements the Query/UserGroupMembers gRPC method
func (Keeper) UserGroups ¶
func (k Keeper) UserGroups(ctx context.Context, request *types.QueryUserGroupsRequest) (*types.QueryUserGroupsResponse, error)
UserGroups implements the Query/UserGroups gRPC method
func (Keeper) UserPermissions ¶
func (k Keeper) UserPermissions(ctx context.Context, request *types.QueryUserPermissionsRequest) (*types.QueryUserPermissionsResponse, error)
UserPermissions implements the Query/UserPermissions gRPC method