MCPcopy Index your code
hub / github.com/DeluxeOwl/kala-go

github.com/DeluxeOwl/kala-go @v0.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.1 ↗ · + Follow
1,674 symbols 3,788 edges 99 files 1,478 documented · 88%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

https://kala.andreisurugiu.com/

An authorization and policy engine written in go.

1

DEV

In ./website, create an .env.local with:

NEXT_PUBLIC_BACKEND_URL="http://127.0.0.1:1323/v0"

Example of config

type: user
---
type: group
relations:
  member: user

---
type: folder
relations:
  reader: user | group#member

---
type: document
relations:
  parent_folder: folder
  writer: user
  reader: user
permissions:
  read: reader | writer | parent_folder.reader
  read_and_write: reader & writer
  read_only: reader & !writer
document:report.csv #reader @user:anna
document:report.csv #writer @user:anna

folder:secret_folder #parent_folder @document:report.csv
folder:secret_folder #reader @user:john

group:dev #member @user:steve

folder:secret_folder #reader @group:dev#member

folder:secret_folder #reader @group:test_group#member

How to use

The whole website is CLI driven, press Ctrl+Shift+K for help

  1. After you finish modifying your config, you need to reload the changes by pressing Ctrl+K
  2. Add tuples to the database using the "Tuples" tab
  3. Verify permissions using the "PermissionCheck" tab

Extension points exported contracts — how you extend this code

Committer (Interface)
Committer is the interface that wraps the Commit method. [2 implementers]
ent/tx.go
OrderFunc (FuncType)
OrderFunc applies an ordering on the sql selector.
ent/ent.go
Option (FuncType)
Option function to configure the client.
ent/config.go
PermissionFunc (FuncType)
The PermissionFunc type is an adapter to allow the use of ordinary function as Permission mutator.
ent/hook/hook.go
TestingT (Interface)
TestingT is the interface that is shared between testing.T and testing.B and used by enttest.
ent/enttest/enttest.go
Permission (FuncType)
Permission is the predicate function for permission builders.
ent/predicate/predicate.go
PermissionCheck (Interface)
(no doc)
website/types/permissionCheck.tsx
ItemProps (Interface)
(no doc)
website/components/ExampleChange.tsx

Core symbols most depended-on inside this repo

Where
called by 240
ent/tuple_query.go
Query
called by 42
ent/tx.go
Dialect
called by 38
ent/tx.go
Mutate
called by 32
ent/hook/hook.go
Error
called by 30
ent/enttest/enttest.go
Name
called by 17
ent/mutation.go
Only
called by 15
ent/tuple_query.go
Close
called by 15
ent/tx.go

Shape

Method 1,185
Function 356
Struct 92
FuncType 24
Interface 10
TypeAlias 5
Class 2

Languages

Go96%
TypeScript4%

Modules by API surface

ent/mutation.go283 symbols
ent/client.go98 symbols
ent/typeconfig_query.go81 symbols
ent/relation_query.go81 symbols
ent/tuple_query.go79 symbols
ent/permission_query.go77 symbols
ent/subject_query.go75 symbols
ent/typeconfig_update.go58 symbols
ent/relation_update.go58 symbols
ent/tuple/where.go49 symbols
ent/relation/where.go48 symbols
ent/permission/where.go44 symbols

For agents

$ claude mcp add kala-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact