Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Last active November 14, 2023 10:16
Show Gist options
  • Save csuwildcat/935109702186835093ec885a10704838 to your computer and use it in GitHub Desktop.
Save csuwildcat/935109702186835093ec885a10704838 to your computer and use it in GitHub Desktop.
{
definition: {
protocol: "https://protocol.example",
types: {
community: {
schema: "https://protocol.example/community",
dataFormats: ["application/json"]
},
member: {
schema: "https://protocol.example/member",
dataFormats: ["application/json"]
},
photo: {
dataFormats: ["image/png", "image/jpeg", "image/gif"]
},
admin: {
schema: "https://protocol.example/admin",
dataFormats: ["application/json"]
},
metadata: {
schema: "https://protocol.example/metadata",
dataFormats: ["application/json"]
}
},
structure: {
community: {
$actions: [
{
role: "admin",
can: "read"
},
{
role: "member",
can: "read"
}
],
admin: {
$contextRole: true,
$actions: [
{
who: "author",
of: "community",
can: "write"
},
{
who: "author",
of: "community",
can: "delete"
}
]
},
member: {
$contextRole: true,
$actions: [
{
role: "admin",
can: "write"
},
{
who: "recipient",
can: "update",
ownRecords: true
},
{
role: "member",
can: "read"
},
{
role: "member",
can: "query"
}
],
photo: {
$actions: [
{
who: "recipient",
of: "member",
can: "write"
},
{
role: "member",
can: "query"
},
{
role: "member",
can: "read"
}
]
},
metadata: {
$actions: [
{
role: "admin",
can: "write"
},
{
role: "admin",
can: "query"
},
{
role: "admin",
can: "read"
}
]
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment