Refactor registration of protected resources (fixes #348, fixes #322) #361
Conversation
7be19b4
to
407c89c
Compare
This commit follows what has been done in mozilla-services/cliquet#361
Looks good to me. r+ |
I'm unclear about what happens if we define a resource without any factory attached. The Authorization policy seems to require a context and as such it doesn't really make sense to be able to set the factory to Another approach would be to:
|
It only makes sense if another AuthzPolicy is used indeed.
This makes a lot of sense, and would like to see it as well. But it requires a lot more efforts on several parts of the code. I wonder if we should do it in the scope of this bug fix... I'll look at your suggestion and see if we can get rid of those configuration lines to specify principals... |
c8f2350
to
cd9debb
Compare
Great, I prefer it much more like that, thanks! |
(r+) |
cd9debb
to
4bf92a1
Compare
4bf92a1
to
1b578e9
Compare
1b578e9
to
a7e22b2
Compare
@@ -252,6 +271,9 @@ def callback(context, name, ob): | |||
class BaseResource(object): | |||
"""Base resource class providing every endpoint.""" | |||
|
|||
default_viewset = ViewSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat.
This commit follows what has been done in mozilla-services/cliquet#361
r? @Natim && @ametaireau