Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## UsersController
- ### Users list
- ##### Пользователи, доступные current_user (те имеющие доступ к тем же приложениям)
- ----
- * **URL**
- `/users`
- * **Method:**
- `GET`
- * **Success Response:**
- * **Code:** 200
- **Content:** `[{"id"=>487, "email"=>"test14@gmail.com"}, {"id"=>488, "email"=>"test15@gmail.com"}]`
- ### Create user
- ----
- * **URL**
- `/users`
- * **Method:**
- `POST`
- * **Params**
- **Required:**
- `email=[string]`
- `password=[string]`
- `client_ids=[array]`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"id"=>506, "email"=>"test@gmail.com"}`
- * **Error Response:**
- * **Code:** 422
- ### User's permissions
- ----
- * **URL**
- `/users/:id/permissions`
- * **Method:**
- `GET`
- * **Params**
- **Required:**
- `id=[integer]`
- `client_id=[integer]`
- * **Success Response:**
- * **Code:** 200
- **Content:** `[{"id"=>329, "abilities"=>{"object1"=>["action1"], "object2"=>["action1", "action2"]}, "client_id"=>1063}]`
- ## ClientsController
- ### Clients list
- ----
- * **URL**
- `/clients`
- * **Method:**
- `GET`
- * **Success Response:**
- * **Code:** 200
- **Content:** `[{"id"=>1, "name"=>"Client", "app_id"=>"89b033ad-1ac8-4a8a-9870-c88dec90af22", "app_secret"=>"07a46e78-4944-4e39-94a8-44df19db5e90"}]`
- ### Create client
- ----
- * **URL**
- `/clients`
- * **Method:**
- `POST`
- * **Params**
- `{'client':{'name':[string], 'app_id':[string], 'app_secret':[string]}}`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"id"=>1, "name"=>"New client", "app_id"=>"3c3213d6ccf36a4d", "app_secret"=>"5223a57bf4bbed82"}`
- * **Error Response:**
- * **Code:** 422
- ## AbilitiesController
- ### Abilities list
- ----
- * **URL**
- `/abilities`
- * **Method:**
- `GET`
- * **Success Response:**
- * **Code:** 200
- **Content:** `[{"id"=>381, "object_name"=>"Something", "actions"=>["action1", "action2"], "client_id"=>1223}]`
- ### Create ability
- ----
- * **URL**
- `/abilities`
- * **Method:**
- `POST`
- * **Params**
- `{'name':[string], 'actions':[array], 'client_id':[integer]}`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"id"=>381, "object_name"=>"object", "actions"=>["action1", "action2"], "client_id"=>1265}`
- * **Error Response:**
- * **Code:** 422
- ## ActionsController
- ### Actions list
- ----
- * **URL**
- `/actions`
- * **Method:**
- `GET`
- * **Params**
- `{'ability_id':[integer]}`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"actions"=>["index", "test"]}`
- ### Create action
- ----
- * **URL**
- `/actions`
- * **Method:**
- `POST`
- * **Params**
- `{'ability_id':[integer], 'action_name':[string]}`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"object_name"=>"Something", "actions"=>["action1", "action2", "action3"], "client_id"=>1392}`
- * **Error Response:**
- * **Code:** 422
- ## PermissionsController
- ### Create action
- ----
- * **URL**
- `/permissions`
- * **Method:**
- `POST`
- * **Params**
- `{'user_id':[integer], 'client_id':[integer], 'abilities':[json]}`
- `abilities example: "{'object1':['action1', 'action2'], 'object2':['action3']}"`
- * **Success Response:**
- * **Code:** 200
- **Content:** `{"id"=>329, "abilities"=>"{'object':['action1']}", "client_id"=>1478}`
- * **Error Response:**
- * **Code:** 422
- ## SessionsController
- ### Login
- ----
- * **URL**
- `/login`
- * **Method:**
- `POST`
- * **Params**
- `{'email':[string], 'password':[string]}`
- * **Error Response:**
- * **Code:** 401
- ### Logout
- ----
- * **URL**
- `/logout`
- * **Method:**
- `GET`
Add Comment
Please, Sign In to add comment