From 6123130f5ba4bba70d00e9fa71170ef5a05635d9 Mon Sep 17 00:00:00 2001 From: Wes Date: Sat, 14 Sep 2013 13:52:10 +0100 Subject: [PATCH] Added 'currentUser' to retrieve the current users information. --- forcetk.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/forcetk.js b/forcetk.js index 3b94914..d5ff855 100644 --- a/forcetk.js +++ b/forcetk.js @@ -304,6 +304,16 @@ if (forcetk.Client === undefined) { }); } + /* + * Lists the information about the current user including their ID, username, + * email address and more. Uses the Chatter REST API. + * @param callback function to which response will be passed + * @param [error=null] function to which jqXHR will be passed in case of error + */ + forcetk.Client.prototype.currentUser = function(callback, error) { + return this.ajax('/' + this.apiVersion + '/chatter/users/me/', callback, error); + } + /* * Lists summary information about each Salesforce.com version currently * available, including the version, label, and a link to each version's