Piazza.Policy (piazza_core v0.3.8) View Source
Simple composable policy, each policy should be of the form:
can?(user, resource, action) -> :continue, {:error, "reason"}, :pass
Policies can then be composed like:
import Core.Policy.SomeModel
...
allow(resource, user, [action]) -> {:ok, resource} | {:error, error}