diff --git a/pallets/common/src/traits/portfolio.rs b/pallets/common/src/traits/portfolio.rs index bbad3a0f2..5bc5b88f4 100644 --- a/pallets/common/src/traits/portfolio.rs +++ b/pallets/common/src/traits/portfolio.rs @@ -201,7 +201,25 @@ decl_event! { IdentityId, PortfolioId, AssetId - ) + ), + /// Allow another identity to create portfolios. + /// + /// # Parameters + /// * [`IdentityId`] of the caller. + /// * [`IdentityId`] allowed to create portfolios. + AllowIdentityToCreatePortfolios( + IdentityId, + IdentityId, + ), + /// Revoke another identities permission to create portfolios. + /// + /// # Parameters + /// * [`IdentityId`] of the caller. + /// * [`IdentityId`] permissions to create portfolios is revoked. + RevokeCreatePortfoliosPermission( + IdentityId, + IdentityId, + ), } } diff --git a/pallets/portfolio/src/lib.rs b/pallets/portfolio/src/lib.rs index 6c6600ff5..910c32f8e 100644 --- a/pallets/portfolio/src/lib.rs +++ b/pallets/portfolio/src/lib.rs @@ -864,6 +864,10 @@ impl Module { Error::::SelfAdditionNotAllowed ); AllowedCustodians::insert(callers_did, trusted_identity, true); + Self::deposit_event(Event::AllowIdentityToCreatePortfolios( + callers_did, + trusted_identity, + )); Ok(()) } @@ -873,6 +877,10 @@ impl Module { ) -> DispatchResult { let callers_did = Identity::::ensure_perms(origin)?; AllowedCustodians::remove(callers_did, identity); + Self::deposit_event(Event::RevokeCreatePortfoliosPermission( + callers_did, + identity, + )); Ok(()) }