Skip to content

Filter Controller Actions via Attributes #122

Closed
@jaredcnance

Description

@jaredcnance

By default, a controller would expose all endpoints, but you should be able to restrict those as needed:

[NoHttpPost]
public class PeopleController : JsonApiController<Person>
{
    public PeopleController(
        IJsonApiContext jsonApiContext,
        IResourceService<Person> resourceService,
        ILoggerFactory loggerFactory) 
        : base(jsonApiContext, resourceService, loggerFactory)
    { }
}

Possible Attributes:

  • NoHttpPost
  • NoHttpPatch
  • NoHttpDelete
  • HttpReadOnly (all of the above)

Response should be 405 and the Accept header should contain a list of acceptable methods

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions