aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-01 19:15:57 -0400
committercash <cash.costello@gmail.com>2011-11-01 19:15:57 -0400
commitdb5cac403c21cc05fa2e34d69c75d1cef583766a (patch)
tree46d392be917db133f890b1478424e81acf459599 /js
parent63ad766f3a37bbe18884abd5d8634ba49b2108d6 (diff)
downloadelgg-db5cac403c21cc05fa2e34d69c75d1cef583766a.tar.gz
elgg-db5cac403c21cc05fa2e34d69c75d1cef583766a.tar.bz2
Fixes #4007 merged in sembrestels fix for ElggUser.isAdmin but used prototype instead of extending object in constructor
Diffstat (limited to 'js')
-rw-r--r--js/classes/ElggUser.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/js/classes/ElggUser.js b/js/classes/ElggUser.js
index 8a7a8b7eb..b8a976fba 100644
--- a/js/classes/ElggUser.js
+++ b/js/classes/ElggUser.js
@@ -6,9 +6,23 @@
* @class Represents an ElggUser
* @property {string} name
* @property {string} username
+ * @property {string} language
+ * @property {boolean} admin
*/
elgg.ElggUser = function(o) {
elgg.ElggEntity.call(this, o);
};
-elgg.inherit(elgg.ElggUser, elgg.ElggEntity); \ No newline at end of file
+elgg.inherit(elgg.ElggUser, elgg.ElggEntity);
+
+/**
+ * Is this user an admin?
+ *
+ * @warning The admin state of the user should be checked on the server for any
+ * actions taken that require admin privileges.
+ *
+ * @return {boolean}
+ */
+elgg.ElggUser.prototype.isAdmin = function() {
+ return this.admin;
+}; \ No newline at end of file