Skip to content

Commit 8f1a7c3

Browse files
authored
Merge pull request #769 from mariogintili/add-authorization-instructions
[README] Add notes on Authorization
2 parents 734029b + 7134075 commit 8f1a7c3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ backed by ActiveRecord models or by custom objects.
4343
* [Key Format] (#key-format)
4444
* [Routing] (#routing)
4545
* [Nested Routes] (#nested-routes)
46+
* [Authorization](#authorization)
4647
* [Configuration] (#configuration)
4748
* [Contributing] (#contributing)
4849
* [License] (#license)
@@ -1200,7 +1201,7 @@ rails generate jsonapi:controller contact
12001201
###### ResourceControllerMetal
12011202
12021203
`JSONAPI::Resources` also provides an alternative class to `ResourceController` called `ResourceControllerMetal`.
1203-
In order to provide a lighter weight controller option this strips the controller down to just the classes needed
1204+
In order to provide a lighter weight controller option this strips the controller down to just the classes needed
12041205
to work with `JSONAPI::Resources`.
12051206
12061207
For example:
@@ -1212,7 +1213,7 @@ end
12121213
```
12131214
12141215
Note: This may not provide all of the expected controller capabilities if you are using additional gems such as DoorKeeper.
1215-
1216+
12161217
###### Serialization Options
12171218
12181219
Additional options can be passed to the serializer using the `serialization_options` method.
@@ -1888,6 +1889,15 @@ phone_number_contact GET /phone-numbers/:phone_number_id/contact(.:format) co
18881889
18891890
```
18901891
1892+
### Authorization
1893+
1894+
Currently `json-api-resources` doesn't come with built-in primitives for authorization. However multiple users of the framework have come up with different approaches, check out:
1895+
1896+
- [jsonapi-authorization](https://github.com/venuu/jsonapi-authorization)
1897+
- [pundit-resources](https://github.com/togglepro/pundit-resources)
1898+
1899+
Refer to the comments/discussion [here](https://github.com/cerebris/jsonapi-resources/issues/16#issuecomment-222438975) for the differences between approaches
1900+
18911901
## Configuration
18921902

18931903
JR has a few configuration options. Some have already been mentioned above. To set configuration options create an

0 commit comments

Comments
 (0)