Crate pallet_roles
source ·Expand description
Roles Pallet
The Roles Pallet is used to set a role for a given AccountId in the FairSquares framework
Overview
The Roles Pallet provides roles management capabilities through the following actions:
- Role setting
- Role attribution to an AccountId
- Role attribution approval or rejection During role setting, the user selects a role from the Accounts enum. Each role has access to specific set of actions used in Fairsquares. there are currently 5 kinds of roles available for selection:
- INVESTOR
- TENANT
- SERVICER
- SELLER The 5th role which is the accounts administrator role is not available during role setting. Sellers and Servicers roles, must be verified/approved by an administrator in order to become active
Dispatchable Functions
Role setting
set_role- Create one of the 4 selectable type of role. In the case of Sellers and Servicers, requests are transfered to a Role approval list. Servicer role (and only Servicer role) can also assign roles to a different user account.
Roles management by Administrator
-
account_approval- This function allows the administrator to verify/approve Seller and Servicer role connection to the requesting AccountId. Verified AccountId are activated, i.e., the requesting AccountId is stored into the corresponding role storage. -
account_rejection- This function allows the administrator to reject Seller and Servicer role connection to the requesting AccountId that are in the approval list, but do not fullfill the FaiSquares guideline. -
set_manager- This function allows the current manager/Sudo_Account to transfer his Administrative authority to a different user/account. Only the current manager can use this function, and he will lose all administrative power by using this function. The Servicer Role is affected to new manager account during this transfer. Previous manager account Servicer Role is revoked.
Re-exports
Modules
Vec<T>.Macros
Ok.$x:expr and if not true return Err($y:expr).Structs
concat(blake2_128(key), key)StorageMap and a StorageValue<Value=u32> to keep track of how many items
are in a map, without needing to iterate all the values.Option<Value>T.Result<Value, PalletError>(key1, key2) couple. Similar to StorageMap but allow
to iterate and remove value associated to first key.(Key<Hasher1, key1>, Key<Hasher2, key2>, ..., Key<HasherN, keyN>).concat(twox64(key), key)ValueVec<T>, short for ‘vector’.Enums
Constants
error field defined in [ModuleError].
In FRAME, this is the maximum encoded size of a pallet error type.Traits
MaxEncodedLen have a statically known maximum encoded size.Lookup in that it doesn’t (can cannot) require any
context.Self.Functions
o represents an unsigned extrinsic. Returns Ok or an Err otherwise.o represents the root. Returns Ok or an Err otherwise.o represents a signed extrinsic (i.e. transaction).
Returns Ok with the account that signed the extrinsic or an Err otherwise.o represents either a signed extrinsic (i.e. transaction) or the root.
Returns Ok with the account that signed the extrinsic, None if it was root, or an Err
otherwise.Type Definitions
BlockNumber associated type of system config.DispatchResultWithPostInfo that can be returned from
dispatchable functions and is automatically converted to the augmented type. Should be
used whenever the PostDispatchInfo does not need to be overwritten. As this should
be the common case it is the implicit return type when none is specified.Dispatchable in frame. When returned explicitly from
a dispatchable function it allows overriding the default PostDispatchInfo
returned from a dispatch.Origin associated type of system config.TransactionLongevity::max_value() means “forever”.Derive Macros
Clone but do not bound any generic. Docs are at frame_support::CloneNoBound.Debug but do not bound any generics. Docs are at frame_support::DebugNoBound.parity_scale_codec::Decode and for struct and enum.parity_scale_codec::Encode and parity_scale_codec::EncodeLike for struct and enum.frame_support::EqNoBound.parity_scale_codec::MaxEncodedLen for struct and enum.PartialEq but do not bound any generic. Docs are at
frame_support::PartialEqNoBound.Debug, if std is enabled it uses frame_support::DebugNoBound, if std is not
enabled it just returns "<stripped>".
This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.