module base

type organisation 
  relations
    define read: [user, role#assignee]
    define update: [user, role#assignee]

type user
  relations
    define read: [user, role#assignee]
    define update: [user, role#assignee]
    define delete: [user, role#assignee]

type anonymous

type role 
  relations
    define assignee: [user]

    define read: [user, role#assignee]
    define update: [user, role#assignee]
    define delete: [user, role#assignee]

type resources
  relations
    define create: [user, role#assignee]
    define list: [user, role#assignee]

    define read: [user, role#assignee]
    define update: [user, role#assignee]
    define delete: [user, role#assignee]

type resource
  relations
      define read: [user, anonymous, role#assignee]
      define update: [user, role#assignee]
      define delete: [user, role#assignee]

      define block: [user, role#assignee]


type telemetry
  relations
      define read: [user, anonymous, role#assignee]
