|
@@ -1,3 +1,4 @@
|
|
|
+use crate::working_group::WorkingGroup;
|
|
|
use codec::{Decode, Encode};
|
|
|
#[cfg(feature = "std")]
|
|
|
use serde::{Deserialize, Serialize};
|
|
@@ -13,21 +14,13 @@ pub struct ContentParameters<ContentId, DataObjectTypeId> {
|
|
|
}
|
|
|
|
|
|
// TODO Reuse enum in ../working_group.rs
|
|
|
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
-#[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
|
|
|
-pub enum WorkingGroupType {
|
|
|
- ContentDirectory,
|
|
|
- Builders,
|
|
|
- StorageProviders,
|
|
|
-}
|
|
|
-
|
|
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
#[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
|
|
|
pub enum AbstractStorageObjectOwner<ChannelId, DAOId> {
|
|
|
Channel(ChannelId), // acts through content directory module, where again DAOs can own channels for example
|
|
|
DAO(DAOId), // acts through upcoming `content_finance` module
|
|
|
Council, // acts through proposal system
|
|
|
- WorkingGroup(WorkingGroupType), // acts through new extrinsic in working group
|
|
|
+ WorkingGroup(WorkingGroup), // acts through new extrinsic in working group
|
|
|
}
|
|
|
|
|
|
// New owner type for storage object struct
|
|
@@ -49,4 +42,10 @@ pub trait StorageSystem<T: crate::StorageOwnership + crate::MembershipTypes> {
|
|
|
owner: StorageObjectOwner<T::MemberId, T::ChannelId, T::DAOId>,
|
|
|
content_parameters: Vec<ContentParameters<T::ContentId, T::DataObjectTypeId>>,
|
|
|
) -> DispatchResult;
|
|
|
+
|
|
|
+ // Checks if given owner can add provided content to the storage system
|
|
|
+ fn can_add_content(
|
|
|
+ owner: StorageObjectOwner<T::MemberId, T::ChannelId, T::DAOId>,
|
|
|
+ content_parameters: Vec<ContentParameters<T::ContentId, T::DataObjectTypeId>>,
|
|
|
+ ) -> DispatchResult;
|
|
|
}
|