Commit graph

13 commits

Author SHA1 Message Date
Zach Daniel
6f2a14715d improvement: show an explanation when no policies apply 2024-09-02 12:48:36 -04:00
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
Barnabas Jovanovics
51e003e4f2
docs: fix call to for_read in auth docs (#1291) 2024-07-08 09:51:56 -04:00
Matheus Cardoso
30d413eb74
docs: Fix typo in Actors and Authorization docs (#1255) 2024-06-23 07:55:56 -04:00
Jinkyou Son
aae679f50e
improvement: Implement show_sensitive? config (#1180)
* Refactor with Ash.Helpers.redact/1

* Implement show_sensitive? config

* Use Application.compile_env/3 instead of Application.get_env/3

* Update sensitive-data.md
2024-05-21 08:47:51 -04:00
m0rt3nlund
d3ff7b1656
Update sensitive-data.md, tyring to clearify that public? applies to … (#1168)
* fix typo

* Update sensitive-data.md, tyring to clearify that public? applies to read

---------

Co-authored-by: Barnabas Jovanovics <barnabas.jovanovics@gmail.com>
2024-05-15 09:31: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
2226b00ca5 docs: more condensation/relocation of docs 2024-04-07 10:11:19 -04:00
Zach Daniel
f9eff8810f docs: refactor security guides 2024-04-06 17:40:05 -04:00