From db5cac403c21cc05fa2e34d69c75d1cef583766a Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 1 Nov 2011 19:15:57 -0400 Subject: Fixes #4007 merged in sembrestels fix for ElggUser.isAdmin but used prototype instead of extending object in constructor --- engine/classes/ElggUser.php | 1 + js/classes/ElggUser.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3