GithubHelp home page GithubHelp logo

Comments (9)

michielkeijts avatar michielkeijts commented on May 18, 2024 1

I see your point. I think I agree with you. The mapresolver can be left as it is and a different 'ORMMapResolver' or so can be added for this use case. I can make a suggestion (merge request) if you like.

However, I think the reason I thought this was an issue, is because the documentation writes about the combination of the Map and ORM resolver. This combination does not work as fluent as it is suggested over there, hence this issue. Should we mention this more explicit?

from authorization.

markstory avatar markstory commented on May 18, 2024

The map resolver is meant to cover simple mapping scenarios. Have you considered building your own resolver that applies the conventions you want to have? The ResolverInterface is intentionally small to make this kind of customisation possible.

from authorization.

michielkeijts avatar michielkeijts commented on May 18, 2024

Yes I have. Indeed, implementing a resolver yourself is an option. But my point here is that I was expect the ORM resolver and the Map resolver to search for the same policy, in order to map them differently. This is not happening as the ORM resolver translates the Query resource to a policy for Table objects.

from authorization.

markstory avatar markstory commented on May 18, 2024

But the MapResolver is a simple map, and you're applying a policy to to a Query not a table.

from authorization.

michielkeijts avatar michielkeijts commented on May 18, 2024

Well, the point is that I implemented the ORM resolver without having policies defined. I got a missing policy exception, for a CoinsTablePolicy. However, by mapping this policy onto the CoinsPolicy, it resulted in the behaviour I am describing.

I still think the Mapresolver should be able to map a policy like a TablePolicy to any other custom policy. This is also not possible at the moment, as the Mapresolver simply not looks for a TablePolicy when a Query $resource is supplied.

from authorization.

markstory avatar markstory commented on May 18, 2024

I still think the Mapresolver should be able to map a policy like a TablePolicy to any other custom policy.

But this isn't a 'map' anymore. It is a map with ORM specific features added in. I'm not against having a different Resolver for that use case, but I disagree that the behaviour you're describing belongs in MapResolver.

from authorization.

markstory avatar markstory commented on May 18, 2024

Both of those changes sound good to me.

from authorization.

dereuromark avatar dereuromark commented on May 18, 2024

ping @michielkeijts

from authorization.

othercorey avatar othercorey commented on May 18, 2024

Closing since the solution is a custom resolver.

from authorization.

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.