summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-01-21 15:23:03 +0100
committerVincent Petry <pvince81@owncloud.com>2016-01-25 10:07:47 +0100
commitd4198607ec0b54be22781c2f48037cd449ee2fea (patch)
tree3c94224e644c77450aa1a4aa005f3baea482dd95 /core
parentce753231eb3ed36a2f5250a2b9cc118fad8dad37 (diff)
downloadnextcloud-server-d4198607ec0b54be22781c2f48037cd449ee2fea.tar.gz
nextcloud-server-d4198607ec0b54be22781c2f48037cd449ee2fea.zip
Expose whether user is an admin through a method
Which is nicer than an obscure global variable
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js
index d24a46fc0bb..74121fa3d80 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -6,6 +6,8 @@
* The undefined checks fix the broken ie8 console
*/
+/* global oc_isadmin */
+
var oc_debug;
var oc_webroot;
@@ -674,7 +676,17 @@ var OC={
*/
getLocale: function() {
return $('html').prop('lang');
- }
+ },
+
+ /**
+ * Returns whether the current user is an administrator
+ *
+ * @return {bool} true if the user is an admin, false otherwise
+ * @since 9.0.0
+ */
+ isUserAdmin: function() {
+ return oc_isadmin;
+ },
};
/**