Myrmyr
AEAsh Elixir
•Created by Myrmyr on 9/29/2023 in #support
Forbid all but one field using field policies
Hello, I need to forbid Anonymous actor access to all fields but id and
status
. Basically it's needed for some calulcations but we don't want him to have access to any other data. So I've tried using policies like this:
But this seems to not be working, probably because for status
filed Ash checks policies from both status
and :*
. Is there any way to achieve that?4 replies
AEAsh Elixir
•Created by Myrmyr on 7/20/2023 in #support
Ash dropping FilterCheck if there's `authorize_if always()`
Hi, I've got a resource that in it's action has:
Previously there were other checks instead of
always()
but we've loosened our constraints.
When we've changed it to always()
the FilterByActorID stopped applying
My question is, is this the intended behaviour or is it a bug?18 replies
AEAsh Elixir
•Created by Myrmyr on 6/27/2023 in #support
Updating Spark to 1.1.17 breaks Ash.Flow transaction DSL
Ash version: 2.10.2
Spark latest working version: 1.1.16
Spark version that breaks: 1.1.17
Example code:
Error message:
Didn't know whether this should be reported to Spark or Ash so I'm reporting it here.
3 replies
AEAsh Elixir
•Created by Myrmyr on 5/9/2023 in #support
Prevent action's changes from being run on `AshPhoenix.Form.validate`
Hello,
I have an resource
A
that has a filed let's say capacity
, belongs_to relationship to B
resource and create
action that has a change LoadDefaultFromRelationship
. This change basically fetches the capacity
from B
resource if none was given in the create
action params for A
.
The problem with such approach is that every time we invoke the AshPhoenix.Form.validate
it makes a query to the database for this default value. Is there any way to prevent this change being run on AshPhoenix.Form.validate
but still apply on create
action?7 replies
AEAsh Elixir
•Created by Myrmyr on 4/3/2023 in #support
`Ash.Type.NewType` defines multiple GraphQL types with the same name.
I have the following custom type
That is used in two resources
Also I've defined a Scalar and imported it to schema
20 replies
AEAsh Elixir
•Created by Myrmyr on 3/16/2023 in #support
Embed `has_one` relationship into resource
Let's say I have a resource A.
It has relationship:
which holds some fields that should be versioned if any changes happen, it has at least one
:a_version
Let's say the AVersion
has the a :price
attribute.
We can define the manual fake "has_one" relationship, by making a query that takes the latest version of AVersion
.
Now, here's question. Is there any way to embed the fields from the latest AVersion
from the fake "has_one" manual relationship into A
so that they can be:
- Accessed at top-level like A.price
- Loaded automatically
as if they were attributes of the A
itself?38 replies
AEAsh Elixir
•Created by Myrmyr on 2/9/2023 in #support
Ash stopped working with ExMachina. Ash 2.5.10
Hello,
I've been using Ash with ExMachina successfully up to this point. Recently I've wanted to upgrade Ash from 2.5.9 to 2.6.0, alongside AshPostgres from 1.3.3 to 1.3.8. I've tested combinations of different Ash and AshPostgres combinations to narrow down the issue. It appears to be caused by Ash 2.5.10. Specifically this commit https://github.com/ash-project/ash/commit/2787b5074b8b339057af6f0bc4ee3db5abf7c60d
Our factory:
When I try to do
insert(:resource, some_field: "some_value)
I get the following error
Is there any possibility to bring back the support for ExMachina?29 replies