Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Last active October 19, 2023 19:06
Show Gist options
  • Save csuwildcat/2ac6ebf4c581c5df143c32fa4911850e to your computer and use it in GitHub Desktop.
Save csuwildcat/2ac6ebf4c581c5df143c32fa4911850e to your computer and use it in GitHub Desktop.
{
"interface": "Protocols",
"method": "Configure",
"definition": {
"protocol": "https://chat.protocol/",
"types": {
"thread": {
"schema": "https://chat.protocol/schemas/thread",
"dataFormat": [
"application/json"
]
},
"message": {
"schema": "https://chat.protocol/schemas/message",
"dataFormat": [
"application/json"
]
},
"attachment": {
"dataFormat": [
"image/png",
"image/gif",
"image/jpeg",
"application/mp4",
"audio/mp4"
]
},
"friend": {
"schema": "https://chat.protocol/schemas/friend",
"dataFormat": [
"application/json"
]
},
"admin": {
"schema": "https://chat.protocol/schemas/admin",
"dataFormat": [
"application/json"
]
},
"participant": {
"schema": "https://chat.protocol/schemas/participant",
"dataFormat": [
"application/json"
]
},
"invite": {
"schema": "https://chat.protocol/schemas/invite",
"dataFormat": [
"application/json"
]
}
},
"structure": {
"friend": {
"$role": true
},
"invite": {
"$actions": [
{
"who": "anyone",
"can": "write"
}
]
},
"thread": {
"$actions": [
{
"role": "friend",
"can": "write"
}
],
"admin": {
"$role": true,
"$actions": [
{
"who": "author",
"of": "thread",
"can": "write"
},
{
"role": "thread/admin",
"can": "write"
},
{
"role": "thread/admin",
"can": "delete"
},
]
},
"participant": {
"$role": true,
"$actions": [
{
"role": "thread/admin",
"can": "write"
}
]
},
"message": {
"$actions": [
{
"role": "thread/participant",
"can": "write"
},
{
"role": "thread/participant",
"can": "delete"
}
],
"attachment": {
"$actions": [
{
"who": "author",
"of": "thread/message",
"can": "write"
},
{
"who": "author",
"of": "thread/message",
"can": "delete"
}
]
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment