From d4198607ec0b54be22781c2f48037cd449ee2fea Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 21 Jan 2016 15:23:03 +0100 Subject: Expose whether user is an admin through a method Which is nicer than an obscure global variable --- core/js/js.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'core/js') 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; + }, }; /** -- cgit v1.2.3