55 views
# [#7 Authorization](https://framagit.org/incommon.cc/incommon-api/issues/7) INCOMMON API [TOC] ## Introductory ### Documentation outline :::info https://pad.degrowth.net/s/incommon-api-documentation-outline ::: ### Modify database state to configure roles ```ruby agent = Agent.i18n.find_by(name: 'IN COMMON Agent') agent.roles user = User.find_by(api_token: "23d8009f-f2ec-44b6-bcbe-58ad1d3af10b") user.roles role = Role.find_or_create_by!(user_id: "-1", agent_id: "-1", roles: "1") role.roles = 2 role.save ``` ## Conduct ### Rails application :::info https://pad.degrowth.net/s/incommon-api-rails ::: ### Specs :::info https://pad.degrowth.net/s/incommon-api-7-specs ::: ### Models :::info https://pad.degrowth.net/s/incommon-api-models ::: ### Integration test :::info https://pad.degrowth.net/s/incommon-api-7-integration-test ::: ## Supplementary ### Database :::info https://pad.degrowth.net/s/incommon-api-database ::: ### Debugging :::info https://pad.degrowth.net/s/incommon-api-debug ::: ## Postponed ### v1 proposal :::info https://pad.degrowth.net/s/incommon-api-v1-proposal ::: ### JSON Patch * [RFC 6902 - JavaScript Object Notation (JSON) Patch](https://tools.ietf.org/html/rfc6902) * [JSON Patch | jsonpatch.com](http://jsonpatch.com/) * [tenderlove/hana: An implementation of JSON Patch and JSON Pointer](https://github.com/tenderlove/hana) * [Understanding JSON Patch - Kevin Sookocheff](https://sookocheff.com/post/api/understanding-json-patch/) ### JSONAPI * [jsonapi-rb](http://jsonapi-rb.org/) * [jsonapi-rb Serialization - Defining resources](http://jsonapi-rb.org/guides/serialization/defining.html) * [jsonapi-rb Serialization - Rendering resources](http://jsonapi-rb.org/guides/serialization/rendering.html) * [jsonapi-rb Deserialization - Deserializing resources](http://jsonapi-rb.org/guides/deserialization/deserializing.html)