aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--engine/classes/ElggUser.php1
-rw-r--r--js/classes/ElggUser.js16
2 files changed, 16 insertions, 1 deletions
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 75ac008f6..51440687d 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -526,6 +526,7 @@ class ElggUser extends ElggEntity
'name',
'username',
'language',
+ 'admin',
));
}
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