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}

Link to this section Summary

Link to this section Functions

Link to this function

resolve_policy(policy_module, resource, user, list)

View Source