mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 00:56:16 -04:00
Expose whether user is an admin through a method
Which is nicer than an obscure global variable
This commit is contained in:
parent
ce753231eb
commit
d4198607ec
1 changed files with 13 additions and 1 deletions
|
|
@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue