Piazza.Policy (piazza_core v0.3.5) 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}

Link to this section Summary

Link to this section Functions