Browse Source

runtime: content-directory: Change CuratorId type.

Shamil Gadelshin 4 years ago
parent
commit
db94b2b8a2

+ 2 - 0
runtime-modules/common/src/lib.rs

@@ -29,6 +29,7 @@ pub trait Trait: frame_system::Trait {
         + Default
         + Copy
         + MaybeSerialize
+        + Ord
         + PartialEq;
 
     /// Describes the common type for the working group members (workers).
@@ -39,6 +40,7 @@ pub trait Trait: frame_system::Trait {
         + Default
         + Copy
         + MaybeSerialize
+        + Ord
         + PartialEq;
 }
 

+ 1 - 1
runtime-modules/content-directory/Cargo.toml

@@ -10,7 +10,7 @@ sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://
 frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
 frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
 sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
-codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive']}
 serde = {version = '1.0.101', features = ['derive'], optional = true}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 

+ 27 - 28
runtime-modules/content-directory/src/lib.rs

@@ -185,6 +185,9 @@ pub type StoredPropertyValueOf<T> = StoredPropertyValue<
     <T as Trait>::Nonce,
 >;
 
+/// Curator ID alias for the actor of the system.
+pub type CuratorId<T> = common::ActorId<T>;
+
 /// Module configuration trait for this Substrate module.
 pub trait Trait: frame_system::Trait + ActorAuthenticator + common::Trait {
     /// The overarching event type.
@@ -293,7 +296,7 @@ decl_storage! {
         pub EntityById get(fn entity_by_id) config(): map hasher(blake2_128_concat) T::EntityId => EntityOf<T>;
 
         /// Map, representing  CuratorGroupId -> CuratorGroup relation
-        pub CuratorGroupById get(fn curator_group_by_id) config(): map hasher(blake2_128_concat) T::CuratorGroupId => CuratorGroup<T>;
+        pub CuratorGroupById get(fn curator_group_by_id) config(): map hasher(blake2_128_concat) T::CuratorGroupId => CuratorGroup<CuratorId<T>>;
 
         /// Mapping of class id and its property id to the respective entity id and property value hash.
         pub UniquePropertyValueHashes get(fn unique_property_value_hashes): double_map hasher(blake2_128_concat) (T::ClassId, PropertyId), hasher(blake2_128_concat) T::Hash => ();
@@ -342,7 +345,7 @@ decl_module! {
             let curator_group_id = Self::next_curator_group_id();
 
             // Insert empty curator group with `active` parameter set to false
-            <CuratorGroupById<T>>::insert(curator_group_id, CuratorGroup::<T>::default());
+            <CuratorGroupById<T>>::insert(curator_group_id, CuratorGroup::<CuratorId<T>>::default());
 
             // Increment the next curator curator_group_id:
             <NextCuratorGroupId<T>>::mutate(|n| *n += T::CuratorGroupId::one());
@@ -366,7 +369,7 @@ decl_module! {
             let curator_group = Self::ensure_curator_group_exists(&curator_group_id)?;
 
             // We should previously ensure that curator_group  maintains no classes to be able to remove it
-            curator_group.ensure_curator_group_maintains_no_classes()?;
+            ensure_curator_group_maintains_no_classes::<T>(&curator_group)?;
 
             //
             // == MUTATION SAFE ==
@@ -414,7 +417,7 @@ decl_module! {
         pub fn add_curator_to_group(
             origin,
             curator_group_id: T::CuratorGroupId,
-            curator_id: T::CuratorId,
+            curator_id: CuratorId<T>,
         ) -> DispatchResult {
 
             // Ensure given origin is lead
@@ -424,10 +427,10 @@ decl_module! {
             let curator_group = Self::ensure_curator_group_exists(&curator_group_id)?;
 
             // Ensure max number of curators per group limit not reached yet
-            curator_group.ensure_max_number_of_curators_limit_not_reached()?;
+            ensure_max_number_of_curators_limit_not_reached::<T>(&curator_group)?;
 
             // Ensure curator under provided curator_id isn`t a CuratorGroup member yet
-            curator_group.ensure_curator_in_group_does_not_exist(&curator_id)?;
+            ensure_curator_in_group_does_not_exist::<T>(&curator_group, &curator_id)?;
 
             //
             // == MUTATION SAFE ==
@@ -448,7 +451,7 @@ decl_module! {
         pub fn remove_curator_from_group(
             origin,
             curator_group_id: T::CuratorGroupId,
-            curator_id: T::CuratorId,
+            curator_id: CuratorId<T>,
         ) -> DispatchResult {
 
             // Ensure given origin is lead
@@ -458,7 +461,7 @@ decl_module! {
             let curator_group = Self::ensure_curator_group_exists(&curator_group_id)?;
 
             // Ensure curator under provided curator_id is CuratorGroup member
-            curator_group.ensure_curator_in_group_exists(&curator_id)?;
+            ensure_curator_in_group_exists::<T>(&curator_group, &curator_id)?;
 
             //
             // == MUTATION SAFE ==
@@ -987,7 +990,7 @@ decl_module! {
         }
 
         // ======
-        // The next set of extrinsics can be invoked by anyone who can properly sign for provided value of `Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>`.
+        // The next set of extrinsics can be invoked by anyone who can properly sign for provided value of `Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>`.
         // ======
 
         /// Create entity.
@@ -997,7 +1000,7 @@ decl_module! {
         pub fn create_entity(
             origin,
             class_id: T::ClassId,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
         ) -> DispatchResult {
 
             let account_id = ensure_signed(origin)?;
@@ -1081,7 +1084,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn remove_entity(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
         ) -> DispatchResult {
 
@@ -1147,7 +1150,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn add_schema_support_to_entity(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
             schema_id: SchemaId,
             new_property_values: BTreeMap<PropertyId, InputPropertyValue<T>>
@@ -1247,7 +1250,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_entity_property_values(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
             new_property_values: BTreeMap<PropertyId, InputPropertyValue<T>>
         ) -> DispatchResult {
@@ -1346,7 +1349,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn clear_entity_property_vector(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
             in_class_schema_property_id: PropertyId
         ) -> DispatchResult {
@@ -1426,7 +1429,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn remove_at_entity_property_vector(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
             in_class_schema_property_id: PropertyId,
             index_in_property_vector: VecMaxLength,
@@ -1530,7 +1533,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn insert_at_entity_property_vector(
             origin,
-            actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
             entity_id: T::EntityId,
             in_class_schema_property_id: PropertyId,
             index_in_property_vector: VecMaxLength,
@@ -1637,7 +1640,7 @@ decl_module! {
 
        /// Batch transaction
        #[weight = 10_000_000] // TODO: adjust weight
-       pub fn transaction(origin, actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>, operations: Vec<OperationType<T>>) -> DispatchResult {
+       pub fn transaction(origin, actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>, operations: Vec<OperationType<T>>) -> DispatchResult {
 
            // Ensure maximum number of operations during atomic batching limit not reached
            Self::ensure_number_of_operations_during_atomic_batching_limit_not_reached(&operations)?;
@@ -1732,7 +1735,7 @@ impl<T: Trait> Module<T> {
     /// Deposits an `TransactionFailed` event if an error during `transaction` extrinsic execution occured
     fn ensure_transaction_failed_event<R, E: Into<DispatchError>>(
         result: Result<R, E>,
-        actor: Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+        actor: Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
         index: usize,
     ) -> Result<R, DispatchError> {
         match result {
@@ -2231,7 +2234,7 @@ impl<T: Trait> Module<T> {
     fn ensure_class_entity_and_access_level(
         account_id: T::AccountId,
         entity_id: T::EntityId,
-        actor: &Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+        actor: &Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
     ) -> Result<(ClassOf<T>, EntityOf<T>, EntityAccessLevel), Error<T>> {
         // Ensure Entity under given id exists, retrieve corresponding one
         let entity = Self::ensure_known_entity_id(entity_id)?;
@@ -2313,7 +2316,7 @@ impl<T: Trait> Module<T> {
     pub fn ensure_can_create_entities(
         class_permissions: &ClassPermissions<T::CuratorGroupId>,
         account_id: &T::AccountId,
-        actor: &Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+        actor: &Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
     ) -> Result<(), Error<T>> {
         let can_create = match &actor {
             Actor::Lead => {
@@ -2330,11 +2333,7 @@ impl<T: Trait> Module<T> {
                 if class_permissions.is_maintainer(curator_group_id) =>
             {
                 // Authorize curator, performing all checks to ensure curator can act
-                CuratorGroup::<T>::perform_curator_in_group_auth(
-                    curator_id,
-                    curator_group_id,
-                    account_id,
-                )?;
+                perform_curator_in_group_auth::<T>(curator_id, curator_group_id, account_id)?;
                 true
             }
             _ => false,
@@ -2628,7 +2627,7 @@ impl<T: Trait> Module<T> {
     /// Ensure `CuratorGroup` under given id exists, return corresponding one
     pub fn ensure_curator_group_exists(
         curator_group_id: &T::CuratorGroupId,
-    ) -> Result<CuratorGroup<T>, Error<T>> {
+    ) -> Result<CuratorGroup<CuratorId<T>>, Error<T>> {
         Self::ensure_curator_group_under_given_id_exists(curator_group_id)?;
         Ok(Self::curator_group_by_id(curator_group_id))
     }
@@ -2874,7 +2873,7 @@ decl_event!(
     pub enum Event<T>
     where
         CuratorGroupId = <T as ActorAuthenticator>::CuratorGroupId,
-        CuratorId = <T as ActorAuthenticator>::CuratorId,
+        CuratorId = CuratorId<T>,
         ClassId = <T as Trait>::ClassId,
         EntityId = <T as Trait>::EntityId,
         EntityController = EntityController<<T as common::Trait>::MemberId>,
@@ -2882,7 +2881,7 @@ decl_event!(
         Status = bool,
         Actor = Actor<
             <T as ActorAuthenticator>::CuratorGroupId,
-            <T as ActorAuthenticator>::CuratorId,
+            CuratorId<T>,
             <T as common::Trait>::MemberId,
         >,
         Nonce = <T as Trait>::Nonce,

+ 2 - 15
runtime-modules/content-directory/src/permissions.rs

@@ -22,19 +22,6 @@ use common::working_group::WorkingGroupIntegration;
 
 /// Model of authentication manager.
 pub trait ActorAuthenticator: frame_system::Trait + common::Trait {
-    /// Curator identifier
-    type CuratorId: Parameter
-        + Member
-        + BaseArithmetic
-        + Codec
-        + Default
-        + Copy
-        + Clone
-        + MaybeSerializeDeserialize
-        + Eq
-        + PartialEq
-        + Ord;
-
     /// Curator group identifier
     type CuratorGroupId: Parameter
         + Member
@@ -49,7 +36,7 @@ pub trait ActorAuthenticator: frame_system::Trait + common::Trait {
         + Ord;
 
     /// Authorize actor as curator
-    fn is_curator(curator_id: &Self::CuratorId, account_id: &Self::AccountId) -> bool;
+    fn is_curator(curator_id: &CuratorId<Self>, account_id: &Self::AccountId) -> bool;
 
     /// Authorize actor as member
     fn is_member(member_id: &Self::MemberId, account_id: &Self::AccountId) -> bool;
@@ -57,7 +44,7 @@ pub trait ActorAuthenticator: frame_system::Trait + common::Trait {
 
 /// Ensure curator authorization performed succesfully
 pub fn ensure_curator_auth_success<T: Trait>(
-    curator_id: &T::CuratorId,
+    curator_id: &CuratorId<T>,
     account_id: &T::AccountId,
 ) -> Result<(), Error<T>> {
     ensure!(

+ 72 - 68
runtime-modules/content-directory/src/permissions/curator_group.rs

@@ -3,9 +3,9 @@ use super::*;
 /// A group, that consists of `curators` set
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
 #[derive(Encode, Decode, Eq, PartialEq, Clone)]
-pub struct CuratorGroup<T: Trait> {
-    /// Curators set, associated with a iven curator group
-    curators: BTreeSet<T::CuratorId>,
+pub struct CuratorGroup<CuratorId: Ord> {
+    /// Curators set, associated with a given curator group
+    curators: BTreeSet<CuratorId>,
 
     /// When `false`, curator in a given group is forbidden to act
     active: bool,
@@ -14,7 +14,7 @@ pub struct CuratorGroup<T: Trait> {
     number_of_classes_maintained: u32,
 }
 
-impl<T: Trait> Default for CuratorGroup<T> {
+impl<CuratorId: Ord> Default for CuratorGroup<CuratorId> {
     fn default() -> Self {
         Self {
             curators: BTreeSet::new(),
@@ -25,9 +25,9 @@ impl<T: Trait> Default for CuratorGroup<T> {
     }
 }
 
-impl<T: Trait> CuratorGroup<T> {
+impl<CuratorId: Ord> CuratorGroup<CuratorId> {
     /// Check if `CuratorGroup` contains curator under given `curator_id`
-    pub fn is_curator(&self, curator_id: &T::CuratorId) -> bool {
+    pub fn is_curator(&self, curator_id: &CuratorId) -> bool {
         self.curators.contains(curator_id)
     }
 
@@ -46,12 +46,12 @@ impl<T: Trait> CuratorGroup<T> {
     }
 
     /// Retrieve set of all curator_ids related to `CuratorGroup` by reference
-    pub fn get_curators(&self) -> &BTreeSet<T::CuratorId> {
+    pub fn get_curators(&self) -> &BTreeSet<CuratorId> {
         &self.curators
     }
 
     /// Retrieve set of all curator_ids related to `CuratorGroup` by mutable  reference
-    pub fn get_curators_mut(&mut self) -> &mut BTreeSet<T::CuratorId> {
+    pub fn get_curators_mut(&mut self) -> &mut BTreeSet<CuratorId> {
         &mut self.curators
     }
 
@@ -64,69 +64,73 @@ impl<T: Trait> CuratorGroup<T> {
     pub fn decrement_number_of_classes_maintained_count(&mut self) {
         self.number_of_classes_maintained -= 1;
     }
+}
 
-    /// Ensure curator group does not maintain any `Class`
-    pub fn ensure_curator_group_maintains_no_classes(&self) -> Result<(), Error<T>> {
-        ensure!(
-            self.number_of_classes_maintained == 0,
-            Error::<T>::CuratorGroupRemovalForbidden
-        );
-        Ok(())
-    }
+/// Ensure curator group does not maintain any `Class`
+pub fn ensure_curator_group_maintains_no_classes<T: Trait>(
+    cg: &CuratorGroup<CuratorId<T>>,
+) -> Result<(), Error<T>> {
+    ensure!(
+        cg.number_of_classes_maintained == 0,
+        Error::<T>::CuratorGroupRemovalForbidden
+    );
+    Ok(())
+}
 
-    /// Ensure `MaxNumberOfCuratorsPerGroup` constraint satisfied
-    pub fn ensure_max_number_of_curators_limit_not_reached(&self) -> Result<(), Error<T>> {
-        ensure!(
-            self.curators.len() < T::MaxNumberOfCuratorsPerGroup::get() as usize,
-            Error::<T>::CuratorsPerGroupLimitReached
-        );
-        Ok(())
-    }
+/// Ensure `MaxNumberOfCuratorsPerGroup` constraint satisfied
+pub fn ensure_max_number_of_curators_limit_not_reached<T: Trait>(
+    cg: &CuratorGroup<CuratorId<T>>,
+) -> Result<(), Error<T>> {
+    ensure!(
+        cg.curators.len() < T::MaxNumberOfCuratorsPerGroup::get() as usize,
+        Error::<T>::CuratorsPerGroupLimitReached
+    );
+    Ok(())
+}
 
-    /// Ensure curator under given `curator_id` exists in `CuratorGroup`
-    pub fn ensure_curator_in_group_exists(
-        &self,
-        curator_id: &T::CuratorId,
-    ) -> Result<(), Error<T>> {
-        ensure!(
-            self.get_curators().contains(curator_id),
-            Error::<T>::CuratorIsNotAMemberOfGivenCuratorGroup
-        );
-        Ok(())
-    }
+/// Ensure curator under given `curator_id` exists in `CuratorGroup`
+pub fn ensure_curator_in_group_exists<T: Trait>(
+    cg: &CuratorGroup<CuratorId<T>>,
+    curator_id: &CuratorId<T>,
+) -> Result<(), Error<T>> {
+    ensure!(
+        cg.get_curators().contains(curator_id),
+        Error::<T>::CuratorIsNotAMemberOfGivenCuratorGroup
+    );
+    Ok(())
+}
 
-    /// Ensure curator under given `curator_id` does not exist yet in `CuratorGroup`
-    pub fn ensure_curator_in_group_does_not_exist(
-        &self,
-        curator_id: &T::CuratorId,
-    ) -> Result<(), Error<T>> {
-        ensure!(
-            !self.get_curators().contains(curator_id),
-            Error::<T>::CuratorIsAlreadyAMemberOfGivenCuratorGroup
-        );
-        Ok(())
-    }
+/// Ensure curator under given `curator_id` does not exist yet in `CuratorGroup`
+pub fn ensure_curator_in_group_does_not_exist<T: Trait>(
+    cg: &CuratorGroup<CuratorId<T>>,
+    curator_id: &CuratorId<T>,
+) -> Result<(), Error<T>> {
+    ensure!(
+        !cg.get_curators().contains(curator_id),
+        Error::<T>::CuratorIsAlreadyAMemberOfGivenCuratorGroup
+    );
+    Ok(())
+}
 
-    /// Authorize curator, performing all checks to ensure curator can act
-    pub fn perform_curator_in_group_auth(
-        curator_id: &T::CuratorId,
-        curator_group_id: &T::CuratorGroupId,
-        account_id: &T::AccountId,
-    ) -> Result<(), Error<T>> {
-        // Ensure curator authorization performed succesfully
-        ensure_curator_auth_success::<T>(curator_id, account_id)?;
-
-        // Retrieve corresponding curator group
-        let curator_group = Module::<T>::curator_group_by_id(curator_group_id);
-
-        // Ensure curator group is active
-        ensure!(
-            curator_group.is_active(),
-            Error::<T>::CuratorGroupIsNotActive
-        );
-
-        // Ensure curator under given curator_id exists in CuratorGroup
-        Self::ensure_curator_in_group_exists(&curator_group, curator_id)?;
-        Ok(())
-    }
+/// Authorize curator, performing all checks to ensure curator can act
+pub fn perform_curator_in_group_auth<T: Trait>(
+    curator_id: &CuratorId<T>,
+    curator_group_id: &T::CuratorGroupId,
+    account_id: &T::AccountId,
+) -> Result<(), Error<T>> {
+    // Ensure curator authorization performed succesfully
+    ensure_curator_auth_success::<T>(curator_id, account_id)?;
+
+    // Retrieve corresponding curator group
+    let curator_group = Module::<T>::curator_group_by_id(curator_group_id);
+
+    // Ensure curator group is active
+    ensure!(
+        curator_group.is_active(),
+        Error::<T>::CuratorGroupIsNotActive
+    );
+
+    // Ensure curator under given curator_id exists in CuratorGroup
+    ensure_curator_in_group_exists(&curator_group, curator_id)?;
+    Ok(())
 }

+ 3 - 7
runtime-modules/content-directory/src/permissions/entity.rs

@@ -11,7 +11,7 @@ pub enum EntityController<MemberId: Default + PartialEq + Clone + Copy> {
 
 impl<MemberId: Default + PartialEq + Clone + Copy> EntityController<MemberId> {
     /// Create `EntityController` enum representation, using provided `Actor`
-    pub fn from_actor<T: Trait>(actor: &Actor<T::CuratorGroupId, T::CuratorId, MemberId>) -> Self {
+    pub fn from_actor<T: Trait>(actor: &Actor<T::CuratorGroupId, CuratorId<T>, MemberId>) -> Self {
         match &actor {
             Actor::Lead => Self::Lead,
             Actor::Member(member_id) => Self::Member(*member_id),
@@ -139,7 +139,7 @@ impl EntityAccessLevel {
         account_id: &T::AccountId,
         entity_permissions: &EntityPermissions<T::MemberId>,
         class_permissions: &ClassPermissions<T::CuratorGroupId>,
-        actor: &Actor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+        actor: &Actor<T::CuratorGroupId, CuratorId<T>, T::MemberId>,
     ) -> Result<Self, Error<T>> {
         let controller = EntityController::<T::MemberId>::from_actor::<T>(actor);
         match actor {
@@ -154,11 +154,7 @@ impl EntityAccessLevel {
             }
             Actor::Curator(curator_group_id, curator_id) => {
                 // Authorize curator, performing all checks to ensure curator can act
-                CuratorGroup::<T>::perform_curator_in_group_auth(
-                    curator_id,
-                    curator_group_id,
-                    account_id,
-                )?;
+                perform_curator_in_group_auth(curator_id, curator_group_id, account_id)?;
                 match (
                     entity_permissions.controller_is_equal_to(&controller),
                     class_permissions.is_maintainer(curator_group_id),

+ 4 - 2
runtime/src/integration/content_directory.rs

@@ -1,10 +1,12 @@
 use crate::{AccountId, ContentDirectoryWorkingGroupInstance, Runtime};
 
 impl content_directory::ActorAuthenticator for Runtime {
-    type CuratorId = u64;
     type CuratorGroupId = u64;
 
-    fn is_curator(curator_id: &Self::CuratorId, account_id: &AccountId) -> bool {
+    fn is_curator(
+        curator_id: &content_directory::CuratorId<Runtime>,
+        account_id: &AccountId,
+    ) -> bool {
         if let Ok(worker) = working_group::ensure_worker_exists::<
             Runtime,
             ContentDirectoryWorkingGroupInstance,