True when what an action changes holds nothing beyond what the actor holds — the grant ceiling
(MishkaCmsCore.Accounts.Validations.GrantWithinActorScope) asked of the account or the row an
action changes, by the same covering rule (MishkaCmsCore.Accounts.Checks.AccessPermissions.beyond/2).
- An account (
MishkaCmsCore.Accounts.User): every permission it holds, when the action deletes it or changes its email, its password, its authenticator or its site — what signing in as it takes, and where it belongs. A generic action names the account by its:idargument, and deletes it when it is given nothing else. Changing only what the account holds is a grant, held to the grant ceiling instead; anything else asks nothing. - A catalogue row (
MishkaCmsCore.Accounts.Permission): the name a destroy removes, and both names of a rename, which every holder of the row loses and gains. A create names what nobody holds yet, and an update that keeps the name changes no name. - A grant row (
MishkaCmsCore.Accounts.UserPermission) written directly: the permission it grants. Removing one grants nothing, asremove_permissiondoes not.
False for no actor. It only ever narrows a gate: put it beside the checks that authorize, since a policy passing on it alone would authorize whatever no other policy asks about.
policy action(:tenant_update) do
forbid_unless {MishkaCmsCore.Accounts.Checks.AccessPermissions, permissions: ["admin:dashboard:user", "admin:api:user"]}
forbid_unless MishkaCmsCore.Accounts.Checks.WithinCeiling
authorize_if expr(site_id == ^actor(:site_id))
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.