openframe-apiserver
Version:
The Openframe API Server.
120 lines (119 loc) • 2.31 kB
JSON
{
"name": "Artwork",
"plural": "artwork",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"mixins": {
"Timestamp": {},
"IsPublicOrOwner": {}
},
"scopes": {
"stream": {
"where": {
"is_public": true
},
"order": "created DESC"
}
},
"properties": {
"title": {
"type": "string",
"required": true
},
"description": {
"type": "string"
},
"is_public": {
"type": "boolean",
"required": true,
"default": false
},
"url": {
"type": "string",
"required": true
},
"thumb_url": {
"type": "string"
},
"author_name": {
"type": "string"
},
"required_extensions": {
"type": "object",
"required": true,
"default": {}
},
"format": {
"type": "string",
"required": true
},
"options": {
"type": "object",
"require": false
}
},
"validations": [],
"relations": {
"owner": {
"type": "belongsTo",
"model": "OpenframeUser",
"foreignKey": "ownerId"
},
"purchased_by": {
"type": "hasAndBelongsToMany",
"model": "OpenframeUser"
},
"liked_by": {
"type": "hasAndBelongsToMany",
"model": "OpenframeUser",
"foreignKey": ""
},
"collections": {
"type": "hasAndBelongsToMany",
"model": "Collection",
"foreignKey": ""
},
"currently_in": {
"type": "hasMany",
"model": "Frame",
"foreignKey": "currentArtworkId"
}
},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"accessType": "WRITE",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW",
"property": "create"
},
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "admin",
"permission": "ALLOW"
}
],
"methods": {}
}