Browse Source

content_directory integration - initial implementation

iorveth 4 years ago
parent
commit
ae2ef29eb3
3 changed files with 5 additions and 20 deletions
  1. 1 1
      runtime-modules/working-group/src/lib.rs
  2. 1 0
      runtime/src/integration/mod.rs
  3. 3 19
      runtime/src/lib.rs

+ 1 - 1
runtime-modules/working-group/src/lib.rs

@@ -1298,7 +1298,7 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
         Ok(worker)
     }
 
-    fn ensure_worker_exists(worker_id: &WorkerId<T>) -> Result<WorkerOf<T>, Error<T, I>> {
+    pub fn ensure_worker_exists(worker_id: &WorkerId<T>) -> Result<WorkerOf<T>, Error<T, I>> {
         ensure!(
             WorkerById::<T, I>::contains_key(worker_id),
             Error::<T, I>::WorkerDoesNotExist

+ 1 - 0
runtime/src/integration/mod.rs

@@ -1,3 +1,4 @@
+pub mod content_directory;
 pub mod content_working_group;
 pub mod forum;
 pub mod proposals;

+ 3 - 19
runtime/src/lib.rs

@@ -377,24 +377,6 @@ impl versioned_store_permissions::Trait for Runtime {
         integration::versioned_store_permissions::ContentLeadOrSudoKeyCanCreateClasses;
 }
 
-impl content_directory::ActorAuthenticator for Runtime {
-    type CuratorId = u64;
-    type MemberId = u64;
-    type CuratorGroupId = u64;
-
-    fn is_lead(account_id: &AccountId) -> bool {
-        true
-    }
-
-    fn is_curator(curator_id: &Self::CuratorId, account_id: &AccountId) -> bool {
-        true
-    }
-
-    fn is_member(member_id: &Self::MemberId, account_id: &AccountId) -> bool {
-        true
-    }
-}
-
 type EntityId = <Runtime as content_directory::Trait>::EntityId;
 
 parameter_types! {
@@ -530,9 +512,11 @@ impl storage::data_object_storage_registry::Trait for Runtime {
     type ContentIdExists = DataDirectory;
 }
 
+pub type MemberId = u64;
+
 impl membership::Trait for Runtime {
     type Event = Event;
-    type MemberId = u64;
+    type MemberId = MemberId;
     type PaidTermId = u64;
     type SubscriptionId = u64;
     type ActorId = ActorId;