True when an account action would change which permissions the account holds, through its
permission_ids argument.
- A create changes them when
permission_idsnames any permission. - An update or a generic action (its
:idargument names the account) changes them whenpermission_idsis given and differs from what the account holds now. An argument left out, or the account's own permissions sent back unchanged — as the account form does — changes nothing.
A policy condition, so a gate asked only of a grant sits beside the one every edit asks:
policy [action([:tenant_create, :tenant_update]), MishkaCmsCore.Accounts.Checks.ChangesPermissions] do
authorize_if {MishkaCmsCore.Accounts.Checks.AccessPermissions, permissions: ["admin:dashboard:permission", "admin:api:permission"]}
end
Summary
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.