Aplopio / django_rip

MIT License
14 stars 6 forks source link

Support CommandResource #33

Open uttamk opened 8 years ago

uttamk commented 8 years ago

Sometimes we need an API endpoint that just supports a POST or a command in CQRS terms. Today we have a hack that people use which looks like the following

class CommandResource(CrudResource):
    allowed_actions = [CrudActions.CREATE_DETAIL]
    serializer_cls = CommandSerializer

This is not the optimal way of doing it because the authorization step in the pipeline follows the conventions of the CrudResource. i.e. the authorization step says

  def authorize_create_detail(self, request):
    pass

Whereas it should ideally be

 def authorize_command(self, request):
    pass
uttamk commented 8 years ago

@skmvasu