Closed tunchamroeun closed 1 month ago
Ah, interesting. 🤔 perhaps what ought to happen in that case is that we should just force authorization to happen instead of raising an error on authorize?: false
. That allows extensions to say authorize?: false
and just be more gracefully ignored. What do you think?
How come errors are raining down in ash3? The previous version was running smoothly, do you have any idea why this is happening?
Did you update your app as part of the upgrade to have authorize :always
?
No, it is previous code from ash 2
Regardless of why it's happening now but not before, it is correct behavior that it is failing right now (or at least the currently intended behavior).
We have some options:
authorize?: false
.authorize?: false
when a domain is set to authorize :always
that instead of making that an error, it just silently ignores it and sets authorize?: true
instead.AshPaperTrail
that removes the authorize?: false
.It must have been a bug in Ash 2 that was fixed in Ash 3 then, as that is how it was supposed to work (although clearly not ideal for this scenario).
In fact, it certainly was. Certain system use cases were unable to determine whether or not authorization was required because we didn't always have to know the domain when building a changeset. Now we do, and therefore we're properly producing the error here.
Probably what we should do is the first option, for now, and then open an issue to do the 4th option on the next major version release of ash_paper_trail.
I've noticed in ash_paper_trail that setting 'authorize?: false' seems alright since there's no policy applied. However, it might be inherited from the domain configuration, in my opinion.
I've got you. I'm working on this issue.
👍 you can use Ash.Domain.Info.authorize(changeset.domain) == :always
to know if the domain requires authorization always.
Ash.Domain
requires that authorization is run impactcreate_new_version/1
#80Flow: inserted student_services -> rollback by create action on student_service_versions
Domain config
Error