Browse Source

Improved schemas (permissions etc.)

Leszek Wiesner 4 years ago
parent
commit
e8389b900a

+ 2 - 1
content-directory-schemas/inputs/classes/ChannelClass.json

@@ -2,5 +2,6 @@
   "name": "Channel",
   "description": "A channel belonging to certain member. Members can publish certain type of content (ie. videos) through channels.",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 7 - 0
content-directory-schemas/inputs/classes/CurationStatusClass.json

@@ -0,0 +1,7 @@
+{
+  "name": "CurationStatus",
+  "description": "Curation status of a related entity (ie. Video)",
+  "maximum_entities_count": 400,
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": false }
+}

+ 2 - 1
content-directory-schemas/inputs/classes/HttpMediaLocationClass.json

@@ -2,5 +2,6 @@
   "name": "HttpMediaLocation",
   "description": "An object describing http location of media object",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/JoystreamMediaLocationClass.json

@@ -2,5 +2,6 @@
   "name": "JoystreamMediaLocation",
   "description": "An object describing location of media object in a format specific to Joystream platform",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/LicenseClass.json

@@ -2,5 +2,6 @@
   "name": "License",
   "description": "Describes a license the media can be published under",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/MediaLocationClass.json

@@ -2,5 +2,6 @@
   "name": "MediaLocation",
   "description": "An object describing how the related media object can be accessed",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/UserDefinedLicenseClass.json

@@ -2,5 +2,6 @@
   "name": "UserDefinedLicense",
   "description": "Custom license defined by the user",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/VideoClass.json

@@ -2,5 +2,6 @@
   "name": "Video",
   "description": "Describes a Video",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 2 - 1
content-directory-schemas/inputs/classes/VideoMediaClass.json

@@ -2,5 +2,6 @@
   "name": "VideoMedia",
   "description": "Describes a video media object",
   "maximum_entities_count": 400,
-  "default_entity_creation_voucher_upper_bound": 50
+  "default_entity_creation_voucher_upper_bound": 50,
+  "class_permissions": { "any_member": true }
 }

+ 6 - 4
content-directory-schemas/inputs/schemas/ContentCategorySchema.json

@@ -2,17 +2,19 @@
   "className": "ContentCategory",
   "newProperties": [
     {
-      "name": "Name",
+      "name": "name",
       "description": "The name of the category",
       "required": true,
       "unique": true,
-      "property_type": { "Single": { "Text": 64 } }
+      "property_type": { "Single": { "Text": 64 } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
-      "name": "Description",
+      "name": "description",
       "description": "The description of the category",
       "required": false,
-      "property_type": { "Single": { "Text": 1024 } }
+      "property_type": { "Single": { "Text": 1024 } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 19 - 0
content-directory-schemas/inputs/schemas/CurationStatusSchema.json

@@ -0,0 +1,19 @@
+{
+  "className": "CurationStatus",
+  "newProperties": [
+    {
+      "name": "approved",
+      "description": "Indicates whether the content was approved by the Curator",
+      "required": false,
+      "property_type": { "Single": "Bool" },
+      "locking_policy": { "is_locked_from_controller": true }
+    },
+    {
+      "name": "comment",
+      "description": "Short, optional comment from the Curator",
+      "required": false,
+      "property_type": { "Single": { "Text": 256 } },
+      "locking_policy": { "is_locked_from_controller": true }
+    }
+  ]
+}

+ 4 - 2
content-directory-schemas/inputs/schemas/HttpMediaLocationSchema.json

@@ -6,13 +6,15 @@
       "description": "The http url pointing to the media",
       "required": true,
       "unique": false,
-      "property_type": { "Single": { "Text": 256 } }
+      "property_type": { "Single": { "Text": 256 } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "port",
       "description": "The port to use when connecting to the http url (defaults to 80)",
       "required": false,
-      "property_type": { "Single": "Uint16" }
+      "property_type": { "Single": "Uint16" },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 2 - 1
content-directory-schemas/inputs/schemas/JoystreamMediaLocationSchema.json

@@ -6,7 +6,8 @@
       "description": "Id of the data object in the Joystream runtime dataDirectory module",
       "property_type": { "Single": { "Text": 48 } },
       "required": true,
-      "unique": true
+      "unique": true,
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 8 - 4
content-directory-schemas/inputs/schemas/KnownLicenseSchema.json

@@ -8,7 +8,8 @@
       "unique": true,
       "property_type": {
         "Single": { "Text": 16 }
-      }
+      },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "name",
@@ -17,7 +18,8 @@
       "unique": true,
       "property_type": {
         "Single": { "Text": 64 }
-      }
+      },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "description",
@@ -25,7 +27,8 @@
       "required": false,
       "property_type": {
         "Single": { "Text": 1024 }
-      }
+      },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "url",
@@ -33,7 +36,8 @@
       "required": false,
       "property_type": {
         "Single": { "Text": 256 }
-      }
+      },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 6 - 4
content-directory-schemas/inputs/schemas/LanguageSchema.json

@@ -2,17 +2,19 @@
   "className": "Language",
   "newProperties": [
     {
-      "name": "Name",
+      "name": "name",
       "description": "The name of the language (ie. English)",
       "required": true,
-      "property_type": { "Single": { "Text": 64 } }
+      "property_type": { "Single": { "Text": 64 } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
-      "name": "Code",
+      "name": "code",
       "description": "ISO 639-1 code of the language (ie. en)",
       "required": true,
       "unique": true,
-      "property_type": { "Single": { "Text": 2 } }
+      "property_type": { "Single": { "Text": 2 } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 4 - 2
content-directory-schemas/inputs/schemas/MediaLocationSchema.json

@@ -5,13 +5,15 @@
       "name": "httpMediaLocation",
       "description": "A reference to HttpMediaLocation",
       "required": false,
-      "property_type": { "Single": { "Reference": { "className": "HttpMediaLocation", "sameOwner": true } } }
+      "property_type": { "Single": { "Reference": { "className": "HttpMediaLocation", "sameOwner": true } } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "joystreamMediaLocation",
       "description": "A reference to JoystreamMediaLocation",
       "required": false,
-      "property_type": { "Single": { "Reference": { "className": "JoystreamMediaLocation", "sameOwner": true } } }
+      "property_type": { "Single": { "Reference": { "className": "JoystreamMediaLocation", "sameOwner": true } } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 3 - 2
content-directory-schemas/inputs/schemas/VideoMediaEncodingSchema.json

@@ -2,11 +2,12 @@
   "className": "VideoMediaEncoding",
   "newProperties": [
     {
-      "name": "Name",
+      "name": "name",
       "description": "The name of the encoding format (ie. H264_mpeg4)",
       "required": true,
       "unique": true,
-      "property_type": { "Single": { "Text": 32 } }
+      "property_type": { "Single": { "Text": 32 } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 10 - 5
content-directory-schemas/inputs/schemas/VideoMediaSchema.json

@@ -5,31 +5,36 @@
       "name": "encoding",
       "description": "Encoding of the video media object",
       "required": true,
-      "property_type": { "Single": { "Reference": { "className": "VideoMediaEncoding" } } }
+      "property_type": { "Single": { "Reference": { "className": "VideoMediaEncoding" } } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "pixelWidth",
       "description": "Video media width in pixels",
       "required": true,
-      "property_type": { "Single": "Uint16" }
+      "property_type": { "Single": "Uint16" },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "pixelHeight",
       "description": "Video media height in pixels",
       "required": true,
-      "property_type": { "Single": "Uint16" }
+      "property_type": { "Single": "Uint16" },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "size",
       "description": "Video media size in bytes",
       "required": false,
-      "property_type": { "Single": "Uint64" }
+      "property_type": { "Single": "Uint64" },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "location",
       "description": "Location of the video media object",
       "required": true,
-      "property_type": { "Single": { "Reference": { "className": "MediaLocation", "sameOwner": true } } }
+      "property_type": { "Single": { "Reference": { "className": "MediaLocation", "sameOwner": true } } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }

+ 12 - 8
content-directory-schemas/inputs/schemas/VideoSchema.json

@@ -53,7 +53,9 @@
       "name": "media",
       "description": "Reference to VideoMedia",
       "required": true,
-      "property_type": { "Single": { "Reference": { "className": "VideoMedia", "sameOwner": true } } }
+      "unique": true,
+      "property_type": { "Single": { "Reference": { "className": "VideoMedia", "sameOwner": true } } },
+      "locking_policy": { "is_locked_from_controller": true }
     },
     {
       "name": "hasMarketing",
@@ -73,13 +75,6 @@
       "required": true,
       "property_type": { "Single": "Bool" }
     },
-    {
-      "name": "isCurated",
-      "description": "Whether the Video has been curated (verified) by a Curator",
-      "required": true,
-      "property_type": { "Single": "Bool" },
-      "locking_policy": { "is_locked_from_controller": true }
-    },
     {
       "name": "isExplicit",
       "description": "Whether the Video contains explicit material.",
@@ -91,7 +86,16 @@
       "name": "license",
       "description": "A License the Video is published under",
       "required": true,
+      "unique": true,
       "property_type": { "Single": { "Reference": { "className": "License", "sameOwner": true } } }
+    },
+    {
+      "name": "curationStatus",
+      "description": "Video curation status set by the Curator",
+      "required": false,
+      "unique": true,
+      "property_type": { "Single": { "Reference": { "className": "CurationStatus" } } },
+      "locking_policy": { "is_locked_from_controller": true }
     }
   ]
 }