I'm currently trying to setup keto with the permis...
# ory-selfhosting
p
I'm currently trying to setup keto with the permission language, but I'm getting the following error:
{{"error":{"code":404,"status":"Not Found","reason":"Unknown namespace with name \"projects\".","message":"The requested resource could not be found"}
keto.yml
Copy code
namespaces:
  location: "file:///home/ory/keto_namespaces.ts"
keto_namespaces.ts
Copy code
import { Namespace, Context } from "@ory/keto-namespace-types"

class User implements Namespace {}

class Project implements Namespace {
  related: {
    owners: User[]
    editors: User[]
    viewers: User[]
  }

  permits = {
    view: (ctx: Context): boolean =>
      this.related.viewers.includes(ctx.subject) ||
      this.permits.edit(ctx),
    edit: (ctx: Context): boolean =>
      this.related.owners.includes(ctx.subject) ||
      this.related.editors.includes(ctx.subject),
    delete: (ctx: Context): boolean =>
      this.permits.edit(ctx)
  }
}
This worked when defining the namespaces directly in the keto.yml file.