Skip to content

Commit 111773f

Browse files
committed
update documentation
1 parent eb8fece commit 111773f

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![MyGet CI](https://img.shields.io/myget/research-institute/vpre/JsonApiDotNetCore.svg)](https://www.myget.org/feed/research-institute/package/nuget/JsonApiDotNetCore)
77
[![Join the chat at https://gitter.im/json-api-dotnet-core/Lobby](https://badges.gitter.im/json-api-dotnet-core/Lobby.svg)](https://gitter.im/json-api-dotnet-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
88

9-
A framework for building [json:api](http://jsonapi.org/) compliant web servers. It allows you to eliminate a significant amount of boilerplate while offering out-of-the-box features such as sorting, filtering and pagination. This library provides all the required middleware to build a complete server. All you need to focus on is defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy.
9+
A framework for building [json:api](http://jsonapi.org/) compliant web APIs. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy.
1010

1111
## Installation And Usage
1212

@@ -18,7 +18,5 @@ See the documentation [here](https://research-institute.github.io/json-api-dotne
1818
Branch `feat/core-2` is where I am working on .Net Core 2 compatibility tests and package upgrades.
1919
There are several blockers to be aware of:
2020

21-
- Microsoft.AspNetCore.* packages target the runtime (netcoreapp) instead of netstandard.
22-
This will be fixed in future versions.
23-
- EF bug against netcoreapp2.0 runtime ([EntityFramework#8021](https://github.com/aspnet/EntityFramework/issues/8021))
21+
- Microsoft.AspNetCore.* packages target the runtime (netcoreapp) instead of netstandard. [This will be changed in future versions.](https://blogs.msdn.microsoft.com/webdev/2017/05/10/aspnet-2-preview-1/).
2422
- Can't run acceptance testing against postgres on preview runtime [pgsql.EntityFrameworkCore.PostgreSQL#171](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/171#issuecomment-301287257)

docs/Controllers.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,31 @@ public class ThingsController : JsonApiController<Thing, Guid>
3838
}
3939
```
4040

41-
### Controller-level customizations
41+
### Limiting Write Access
4242

43-
If you need to customize things at the controller level, you can override the virtual
43+
It is possible to limit write resource access on the controller entirely using the following attributes:
44+
45+
- `NoHttpPost`: disallow POST requests
46+
- `NoHttpPatch`: disallow PATCH requests
47+
- `NoHttpDelete`: disallow DELETE requests
48+
- `HttpReadOnly`: all of the above
49+
50+
```csharp
51+
[HttpReadOnly]
52+
public class ThingsController : JsonApiController<Thing>
53+
{
54+
public ThingsController(
55+
IJsonApiContext jsonApiContext,
56+
IResourceService<Thing> resourceService,
57+
ILoggerFactory loggerFactory)
58+
: base(jsonApiContext, resourceService, loggerFactory)
59+
{ }
60+
}
61+
```
62+
63+
### Additional customizations
64+
65+
If you need additional customization at the controller level, you can override the virtual
4466
methods. Please be aware that this is not the place for advanced business logic
4567
which should be performed at the [service](resourceservices.html) or [repository](entityrepositories.html) layers. Here is an example override at the controller layer:
4668

0 commit comments

Comments
 (0)