Skip to content

Instantly share code, notes, and snippets.

@flyingsilverfin
Last active July 18, 2022 21:16
Show Gist options
  • Save flyingsilverfin/99dfd8c5436d183ffe6bc4f344f8aa83 to your computer and use it in GitHub Desktop.
Save flyingsilverfin/99dfd8c5436d183ffe6bc4f344f8aa83 to your computer and use it in GitHub Desktop.
Inference in TypeDB - Permissions Schema
define
user sub entity,
plays team-membership:member,
plays read-access:reader,
plays write-access:writer,
plays resource-ownership:owner;
team sub entity,
plays team-membership:team,
plays read-access:reader,
plays write-access:writer,
plays resource-ownership:owner;
resource sub entity,
plays read-access:readable,
plays write-access:writable,
plays resource-ownership:resource;
team-membership sub relation,
relates member,
relates team;
access sub relation, abstract,
relates accessor,
relates resource,
owns permission;
write-access sub access,
relates writer as accessor,
relates writable as resource;
read-access sub access,
relates reader as accessor,
relates readable as resource;
resource-ownership sub relation,
relates owner,
relates resource;
permission sub attribute, value string;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment