Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Models could assume an authorizer based on name, if it exists #27

Closed
nathanl opened this Issue · 5 comments

2 participants

@nathanl
Owner

A possible feature for consideration: models currently start out assuming that their authorizer is ApplicationAuthorizer. The Comment model doesn't automatically look for a CommentAuthorizer because it often makes sense to group multiple models under the same authorizer.

However, wouldn't it be sensible to at least check for the existence of an authorizer with a corresponding name? It's unlikely that you'd create a Comment model and a CommentAuthorizer and not want to hook them together.

If Comment hasn't been told what authorizer to use, should it look for CommentAuthorizer first, then failing that, assume ApplicationAuthorizer?

@adamhunter
Collaborator

:+1: (make sure you handle namespaced models properly though)

@nathanl
Owner

@adamhunter - Good point.

I'd say Piano::Key should look for Piano::KeyAuthorizer, not PianoKeyAuthorizer or somesuch thing. Agreed?

@nathanl
Owner

Also, would you consider this a breaking change, needing a major version bump? If anyone has a CommentAuthorizer and haven't specified an authorizer for Comment, all of a sudden they will get switched from ApplicationAuthorizer. Seems like a small chance, though.

@adamhunter
Collaborator

I think you can get away with a minor version bump. If anything the person in that use case is broken, not Authority.

@nathanl
Owner

Done - released 2.5.0.

@nathanl nathanl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.