Skip to content

Instantly share code, notes, and snippets.

View zachdaniel's full-sized avatar

Zach Daniel zachdaniel

View GitHub Profile
@zachdaniel
zachdaniel / can.ex
Created October 6, 2024 12:18 — forked from kamaroly/can.ex
How To Use Ash framework in Phoenix with user permission example
defmodule MyApp.Accounts.Checks.Can do
use Ash.Policy.SimpleCheck
def describe(_opts) do
"Check if a user/ actor has permission on a specific resource"
end
# @impl true
def match?(nil, _, _), do: false