EACL: Minimal Example from Clojure

July 29, 2025 ยท View on GitHub

This is a minimal example that demonstrates how to use EACL, an embedded SpiceDB-compatible* ReBAC authorization library built in Clojure and backed by Datomic.

The ~70 lines in src/eacl_example/core.clj shows the following:

  1. Install the latest EACL Datomic schema
  2. Transact a small permission schema with resources for users, accounts and products:
  • where a user can own an account,
  • a product has under an account, and
  • users havae basic permissions.
  1. Transact some permissioned entities.
  2. Transact some relationships for [user :owner account] & [account :account product] so EACL can traverse the graph betweend user -> account <- product.
  3. Run some eacl/can? permission checks, which return true or false.
  4. Enumerate the resources a subject can access via eacl/lookup-resources.

Add EACL to a Clojure Project

If you'd like to try this from your project, you'll need the Datomic Peer library and the EACL dependencies in your deps.edn file:

cloudafrica/eacl {:git/url "git@github.com:cloudafrica/eacl.git"
                  :git/sha "715ad6eed9f8b100e502909395126cef65cca27d"}

(or use a newer :git/sha, until EACL is published on Clojars)