# CanI
[![Build Status](](

Simple authorization system for Elixir based applications.

Define your abilities like so:

# Start the agent
# Add abilities
CanI.register(:read, fn user -> user.regular? end)
CanI.register(:delete, fn user -> user.admin? end)

# Add multiple abilities
CanI.register([:insert, :delete], fn user -> user.admin? end)

#=> [{:read, function}, {:delete, function}]

# Fetch a user record from a database that is supposed to be able to
# delete records
CanI.check_ability(:delete, user)
=> true
# Or if there are no arguments involved for the anonymous function
CanI.register(:read, fn -> false end)
=> false

## Installation

If [available in Hex](, the package can be installed
by adding `can_i` to your list of dependencies in `mix.exs`:

def deps do
    {:can_i, "~> 0.1.0"}

Documentation can be generated with [ExDoc](
and published on [HexDocs]( Once published, the docs can
be found at [](