GithubHelp home page GithubHelp logo

Comments (11)

zachdaniel avatar zachdaniel commented on August 20, 2024 1

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:

  1. 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.
  2. Make it such that if you say 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.
  3. add another option, which tells it to adopt the behavior of number 2 above.
  4. make the change and release a major version change to AshPaperTrail that removes the authorize?: false.

from ash_paper_trail.

zachdaniel avatar zachdaniel commented on August 20, 2024 1

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.

zachdaniel avatar zachdaniel commented on August 20, 2024 1

👍 you can use Ash.Domain.Info.authorize(changeset.domain) == :always to know if the domain requires authorization always.

from ash_paper_trail.

zachdaniel avatar zachdaniel commented on August 20, 2024

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.

tunchamroeun avatar tunchamroeun commented on August 20, 2024

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.

zachdaniel avatar zachdaniel commented on August 20, 2024

Did you update your app as part of the upgrade to have authorize :always?

from ash_paper_trail.

tunchamroeun avatar tunchamroeun commented on August 20, 2024

No, it is previous code from ash 2

from ash_paper_trail.

zachdaniel avatar zachdaniel commented on August 20, 2024

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.

zachdaniel avatar zachdaniel commented on August 20, 2024

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.

tunchamroeun avatar tunchamroeun commented on August 20, 2024

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.

tunchamroeun avatar tunchamroeun commented on August 20, 2024

I've got you. I'm working on this issue.

from ash_paper_trail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.