Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Allow for user-level authentication to read/write certain objects #30

Closed

Description

@anachlas

I would imagine you could have a subclass of model controller that only deals with objects that have a userId property, and then in any get, put, or delete request it makes sure the authorization for the request matches the userId otherwise returning a 403. For post requests it could fill in the userId on the valueObject.

Activity

  1. itsjoeconway commented on Jan 15, 2016

    @itsjoeconway
    Contributor

    Agreed (not on the subclass part, but the need for this), I'm currently writing this code at the top of a lot of methods. To pull this off, the ModelController would effectively fetch the object in question prior to even entering the request handler methods. In a simple CRUD service, the GET {id} would basically be done. I think this would be configurable on the controller (just a flag set in the initializer) that defaulted to fetching the object. I think there would be times you'd want to avoid that behavior, but the more likely (Default) behavior should be fetch the object. Perhaps as a similar item, it'd be nice to optionally fetch more of the resource owner object during authentication. It'd be even nicer to do this as an annotation to the controller..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions