diff options
author | cash <cash.costello@gmail.com> | 2011-11-01 19:15:57 -0400 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-11-01 19:15:57 -0400 |
commit | db5cac403c21cc05fa2e34d69c75d1cef583766a (patch) | |
tree | 46d392be917db133f890b1478424e81acf459599 | |
parent | 63ad766f3a37bbe18884abd5d8634ba49b2108d6 (diff) | |
download | elgg-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.php | 1 | ||||
-rw-r--r-- | js/classes/ElggUser.js | 16 |
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 |