]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4007 merged in sembrestels fix for ElggUser.isAdmin but used prototype instead...
authorcash <cash.costello@gmail.com>
Tue, 1 Nov 2011 23:15:57 +0000 (19:15 -0400)
committercash <cash.costello@gmail.com>
Tue, 1 Nov 2011 23:15:57 +0000 (19:15 -0400)
engine/classes/ElggUser.php
js/classes/ElggUser.js

index 75ac008f6bfb90728fa76fa9ff243bed3fcfa77c..51440687d8ffb80d47635bd4bd00c1be0f7e6b71 100644 (file)
@@ -526,6 +526,7 @@ class ElggUser extends ElggEntity
                        'name',
                        'username',
                        'language',
+                       'admin',
                ));
        }
 
index 8a7a8b7eb6657ec9b2ed938ee487c0ea1bce83bd..b8a976fba84cd7b567f31aceb53b13674dca2523 100644 (file)
@@ -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