Comments (11)
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:
- Fx it "locally" here by having AshPaperTrail check to see if the domain requires authorization and if it does, we can not set
authorize?: false
. - Make it such that if you say
authorize?: false
when a domain is set toauthorize :always
that instead of making that an error, it just silently ignores it and setsauthorize?: true
instead. - add another option, which tells it to adopt the behavior of number 2 above.
- make the change and release a major version change to
AshPaperTrail
that removes theauthorize?: false
.
from ash_paper_trail.
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).
from ash_paper_trail.
👍 you can use Ash.Domain.Info.authorize(changeset.domain) == :always
to know if the domain requires authorization always.
from ash_paper_trail.
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?
from ash_paper_trail.
How come errors are raining down in ash3? The previous version was running smoothly, do you have any idea why this is happening?
from ash_paper_trail.
Did you update your app as part of the upgrade to have authorize :always
?
from ash_paper_trail.
No, it is previous code from ash 2
from ash_paper_trail.
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.
from ash_paper_trail.
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.
from 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.
from ash_paper_trail.
I've got you. I'm working on this issue.
from ash_paper_trail.
Related Issues (20)
- Support storing inputs in addition to changes HOT 2
- Implement a behavior for custom types to control how they are diffed HOT 1
- Changes attribute should be sensitive HOT 3
- ignore_attributes hard-coded to :created_at and :updated_at HOT 3
- attributes_as_attributes should also be ignorable
- Introduce `mix check` through CI Github action HOT 2
- When storing `:inputs` and `:changes` scrub them to redact `sensitive` values
- paper_trail_versions should be sorted in ascending order based on version_inserted_at. HOT 2
- Could you release a new version? HOT 1
- Flaky test
- Support bulk action HOT 1
- belongs_to_actor relationship must be public HOT 11
- feat: allow adding metadata to versions HOT 1
- feat: support atomic bulk actions
- Error with missing `changed?` in context with `bulk_destroy` HOT 4
- docs: getting started guide is truncated at the beginning HOT 1
- Error with missing `changed?` in context with `bulk_update` HOT 1
- optimize the atomic/3 behaviour for batches HOT 1
- Latest ash_paper_trail fails. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ash_paper_trail.