Commit graph

7 commits

Author SHA1 Message Date
Rebecca Le
4b42ef2e41
docs: Replace incorrect attribute policy check in Policies guide with an expr (#1393)
There is no built-in check for `attribute` - but the same logic can be expressed readably with a call to `expr`.
2024-08-17 11:00:42 -04:00
Rebecca Le
707de0d664
docs: Fix code typo in Policies guide (#1392) 2024-08-16 08:15:33 -04:00
Zach Daniel
f0c6e86d45 chore: remove unnecessary line in docs 2024-08-12 16:01:58 -04:00
Zach Daniel
dc73c3a3d5 feat: add policy groups
Policy groups allow you to group policies by shared conditions.
This can help simplify the mental overhead of large sets of policies.

For example:

```elixir
policies do
  policy_group actor_attribute_equals(:role, :owner) do
    policy action_type(:read) do
      authorize_if expr(owner_id == ^actor(:id))
    end

    policy action_type([:create, :update, :destroy]) do
      forbid_if
      authorize_if expr(owner_id == ^actor(:id))
    end
  end
end
```
2024-08-09 16:48:54 -04:00
Tore Pettersen
37755a870b
feat: Allow field policies to hide private fields (#1289)
* Allow field policies to hide private fields

* Create option for how to handle private fields

* Improve docs
2024-07-15 08:16:52 -04:00
915fc03565
docs: a few small improvements for actions and policy guides. (#991) 2024-04-07 17:40:36 -04:00
Zach Daniel
f9eff8810f docs: refactor security guides 2024-04-06 17:40:05 -04:00
Renamed from documentation/topics/policies.md (Browse further)