diff --git a/app/controllers/api/v2/restful_controller.rb b/app/controllers/api/v2/restful_controller.rb index 7cc6a44c..00325ba4 100644 --- a/app/controllers/api/v2/restful_controller.rb +++ b/app/controllers/api/v2/restful_controller.rb @@ -45,7 +45,7 @@ module Api end def current_user - token_user || super || doorkeeper_user || nil + token_user || doorkeeper_user || super end def load_resource diff --git a/doc/api/api.raml b/doc/api/api.raml index 8703aae9..45969271 100644 --- a/doc/api/api.raml +++ b/doc/api/api.raml @@ -13,7 +13,7 @@ securitySchemes: cookie: !include securitySchemes/cookie.raml token: !include securitySchemes/token.raml oauth_2_0: !include securitySchemes/oauth_2_0.raml -securedBy: [ cookie, token, oauth_2_0 ] +securedBy: [ token, oauth_2_0, cookie ] traits: pageable: !include traits/pageable.raml diff --git a/doc/api/apis/mappings.raml b/doc/api/apis/mappings.raml index a1643c86..00298387 100644 --- a/doc/api/apis/mappings.raml +++ b/doc/api/apis/mappings.raml @@ -1,6 +1,7 @@ #type: collection get: is: [ embeddable: { embedFields: "user,map" }, orderable, pageable ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: @@ -31,6 +32,7 @@ post: #type: item get: is: [ embeddable: { embedFields: "user,map" } ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: diff --git a/doc/api/apis/maps.raml b/doc/api/apis/maps.raml index 6e9738fe..03c4db2b 100644 --- a/doc/api/apis/maps.raml +++ b/doc/api/apis/maps.raml @@ -1,7 +1,7 @@ #type: collection get: is: [ searchable: { searchFields: "name, desc" }, embeddable: { embedFields: "user,topics,synapses,mappings,contributors,collaborators" }, orderable, pageable ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: @@ -32,7 +32,7 @@ post: #type: item get: is: [ embeddable: { embedFields: "user,topics,synapses,mappings,contributors,collaborators" } ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: diff --git a/doc/api/apis/metacodes.raml b/doc/api/apis/metacodes.raml index 877e1835..b2a48eeb 100644 --- a/doc/api/apis/metacodes.raml +++ b/doc/api/apis/metacodes.raml @@ -1,15 +1,15 @@ #type: collection -securedBy: [ null, cookie, token, oauth_2_0 ] get: is: [ searchable: { searchFields: "name" }, orderable, pageable ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: application/json: example: !include ../examples/metacodes.json /{id}: - securedBy: [ null, cookie, token, oauth_2_0 ] #type: item + securedBy: [ null, token, oauth_2_0, cookie ] get: responses: 200: diff --git a/doc/api/apis/synapses.raml b/doc/api/apis/synapses.raml index 79641e56..c9b37e9f 100644 --- a/doc/api/apis/synapses.raml +++ b/doc/api/apis/synapses.raml @@ -1,7 +1,7 @@ #type: collection get: is: [ searchable: { searchFields: "desc" }, embeddable: { embedFields: "topic1,topic2,user" }, orderable, pageable ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: @@ -34,7 +34,7 @@ post: #type: item get: is: [ embeddable: { embedFields: "topic1,topic2,user" } ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: diff --git a/doc/api/apis/topics.raml b/doc/api/apis/topics.raml index 5b5664fe..c1bce96e 100644 --- a/doc/api/apis/topics.raml +++ b/doc/api/apis/topics.raml @@ -1,7 +1,7 @@ #type: collection get: is: [ searchable: { searchFields: "name, desc, link" }, embeddable: { embedFields: "user,metacode" }, orderable, pageable ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: @@ -31,7 +31,7 @@ post: #type: item get: is: [ embeddable: { embedFields: "user,metacode" } ] - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: diff --git a/doc/api/apis/users.raml b/doc/api/apis/users.raml index 1d37bc0d..082af2f0 100644 --- a/doc/api/apis/users.raml +++ b/doc/api/apis/users.raml @@ -1,7 +1,7 @@ #type: collection -securedBy: [ null, cookie, token, oauth_2_0 ] get: is: [ searchable: { searchFields: "name" }, orderable, pageable ] + securedBy: [ null, token, oauth_2_0, cookie ] responses: 200: body: @@ -9,7 +9,7 @@ get: example: !include ../examples/users.json /{id}: #type: item - securedBy: [ null, cookie, token, oauth_2_0 ] + securedBy: [ null, token, oauth_2_0, cookie ] get: responses: 200: