From 479631aafc525efef151309ac257e60c73230ac0 Mon Sep 17 00:00:00 2001 From: Boyan Tabakov Date: Wed, 31 Jul 2013 13:52:23 +0300 Subject: Extended User API to expose admin and can_create_group for user creation/updating. Also, is_admin and can_create_group are exposed in the user information. Fixed attributes_for_keys to process properly keys with boolean values (since false.present? is false). --- doc/api/users.md | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'doc/api') diff --git a/doc/api/users.md b/doc/api/users.md index 49afbab8c6a..50c0f560d87 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -23,7 +23,9 @@ GET /users "extern_uid": "john.smith", "provider": "provider_name", "theme_id": 1, - "color_scheme_id": 2 + "color_scheme_id": 2, + "is_admin": false, + "can_create_group": true }, { "id": 2, @@ -39,7 +41,9 @@ GET /users "extern_uid": "jack.smith", "provider": "provider_name", "theme_id": 1, - "color_scheme_id": 3 + "color_scheme_id": 3, + "is_admin": false, + "can_create_group": true } ] ``` @@ -72,7 +76,9 @@ Parameters: "extern_uid": "john.smith", "provider": "provider_name", "theme_id": 1, - "color_scheme_id": 2 + "color_scheme_id": 2, + "is_admin": false, + "can_create_group": true } ``` @@ -87,17 +93,19 @@ POST /users Parameters: -+ `email` (required) - Email -+ `password` (required) - Password -+ `username` (required) - Username -+ `name` (required) - Name -+ `skype` (optional) - Skype ID -+ `linkedin` (optional) - Linkedin -+ `twitter` (optional) - Twitter account -+ `projects_limit` (optional) - Number of projects user can create -+ `extern_uid` (optional) - External UID -+ `provider` (optional) - External provider name -+ `bio` (optional) - User's bio ++ `email` (required) - Email ++ `password` (required) - Password ++ `username` (required) - Username ++ `name` (required) - Name ++ `skype` (optional) - Skype ID ++ `linkedin` (optional) - Linkedin ++ `twitter` (optional) - Twitter account ++ `projects_limit` (optional) - Number of projects user can create ++ `extern_uid` (optional) - External UID ++ `provider` (optional) - External provider name ++ `bio` (optional) - User's bio ++ `admin` (optional) - User is admin - true or false (default) ++ `can_create_group` (optional) - User can create groups - true or false ## User modification @@ -121,6 +129,8 @@ Parameters: + `extern_uid` - External UID + `provider` - External provider name + `bio` - User's bio ++ `admin` (optional) - User is admin - true or false (default) ++ `can_create_group` (optional) - User can create groups - true or false Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one. @@ -166,7 +176,6 @@ GET /user "color_scheme_id": 2, "is_admin": false, "can_create_group" : true, - "can_create_team" : true, "can_create_project" : true } ``` -- cgit v1.2.1