diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index afe0d11af1..4dd19bcda1 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -862,7 +862,7 @@ impl pallet_identity::Config for Runtime { type RegistrarOrigin = EitherOf, GeneralAdmin>; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = EitherOf, GeneralAdmin>; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>; diff --git a/system-parachains/people/people-kusama/src/people.rs b/system-parachains/people/people-kusama/src/people.rs index 5f260c9a3d..dc2c708bce 100644 --- a/system-parachains/people/people-kusama/src/people.rs +++ b/system-parachains/people/people-kusama/src/people.rs @@ -39,8 +39,14 @@ parameter_types! { pub const SubAccountDeposit: Balance = system_para_deposit(1, 53); pub RelayTreasuryAccount: AccountId = parachains_common::TREASURY_PALLET_ID.into_account_truncating(); + pub const GeneralAdminBodyId: BodyId = BodyId::Administration; } +pub type IdentityAdminOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -52,10 +58,10 @@ impl pallet_identity::Config for Runtime { type MaxRegistrars = ConstU32<20>; type Slashed = ToParentTreasury; type ForceOrigin = EnsureRoot; - type RegistrarOrigin = EnsureRoot; + type RegistrarOrigin = IdentityAdminOrigin; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = IdentityAdminOrigin; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>; diff --git a/system-parachains/people/people-polkadot/src/people.rs b/system-parachains/people/people-polkadot/src/people.rs index 5f260c9a3d..026ec0f881 100644 --- a/system-parachains/people/people-polkadot/src/people.rs +++ b/system-parachains/people/people-polkadot/src/people.rs @@ -28,6 +28,8 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::prelude::*; +use xcm::latest::prelude::BodyId; +use xcm_config::GovernanceLocation; parameter_types! { // 27 | Min encoded size of `Registration` @@ -39,8 +41,14 @@ parameter_types! { pub const SubAccountDeposit: Balance = system_para_deposit(1, 53); pub RelayTreasuryAccount: AccountId = parachains_common::TREASURY_PALLET_ID.into_account_truncating(); + pub const GeneralAdminBodyId: BodyId = BodyId::Administration; } +pub type IdentityAdminOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -52,10 +60,10 @@ impl pallet_identity::Config for Runtime { type MaxRegistrars = ConstU32<20>; type Slashed = ToParentTreasury; type ForceOrigin = EnsureRoot; - type RegistrarOrigin = EnsureRoot; + type RegistrarOrigin = IdentityAdminOrigin; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = IdentityAdminOrigin; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>;