Skip to content

theronic/eacl-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

EACL: Minimal Example from Clojure

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)

About

EACL Example demonstrating ReBAC Authorization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published