diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-03 09:07:31 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-03 15:49:49 +0200 |
commit | d68be1ae4dd1abbd64c8075ca495d55dc1f491db (patch) | |
tree | 49bb52498acb8940f1fd6d10af22eb1f9b9ede57 /core/src/OC/admin.js | |
parent | a7a35d32fd04d7bdc27261a1fa4a51c91c0b2cab (diff) | |
download | nextcloud-server-d68be1ae4dd1abbd64c8075ca495d55dc1f491db.tar.gz nextcloud-server-d68be1ae4dd1abbd64c8075ca495d55dc1f491db.zip |
Deprecate oc_isadmin and move OC.isUserAdmin() to the bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/OC/admin.js')
-rw-r--r-- | core/src/OC/admin.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/src/OC/admin.js b/core/src/OC/admin.js new file mode 100644 index 00000000000..565af9946f7 --- /dev/null +++ b/core/src/OC/admin.js @@ -0,0 +1,30 @@ +/* + * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * + * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +const isAdmin = !!window._oc_isadmin + +/** + * Returns whether the current user is an administrator + * + * @return {bool} true if the user is an admin, false otherwise + * @since 9.0.0 + */ +export const isUserAdmin = () => isAdmin |