Ash FrameworkAF
Ash Framework4mo ago
8 replies
AngyL75

Ash.Resource.Calculation with field_policy

in a calculation Ash.Resource.Calculation
I have the following load:

def load(_query, _opt, _context),
    do: [
      member_connections: [
        :type,
        :mirror_type,
        :status,
        connected: [:type, user: [:email, :photo_url, :full_phone]],
         ...
      ]
    ]


but user has a field_policy defined to prevent to have :email and :phone_number for specific actors.

Does the load take into account the actor from context?

Else how to do to make sure that field_policy applies with the given actor ?

In my case, I am loading :email and :full_phone_number, not because I need them in the calculation itself.. but later to display them in my page if they are defined.

Regards,
Angy
Was this page helpful?