summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-05-29 16:02:30 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-05-29 16:10:08 +0200
commit02095326385303b1febc74049579df6dc3700f23 (patch)
tree61134fb8309965c466a13479b8f8032495136feb /core/src
parent532f4c41dae98e9cdfe50af6b67806982cd5111f (diff)
downloadnextcloud-server-02095326385303b1febc74049579df6dc3700f23.tar.gz
nextcloud-server-02095326385303b1febc74049579df6dc3700f23.zip
Move to @nextcloud/capabilities package
And kill of oc_capabilities and _oc_capabilities globals Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/OC/capabilities.js7
-rw-r--r--core/src/globals.js1
2 files changed, 5 insertions, 3 deletions
diff --git a/core/src/OC/capabilities.js b/core/src/OC/capabilities.js
index 2e0a8da3995..6e51abce60e 100644
--- a/core/src/OC/capabilities.js
+++ b/core/src/OC/capabilities.js
@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-const capabilities = window._oc_capabilities || {}
+import { getCapabilities as realGetCapabilities } from '@nextcloud/capabilities'
/**
* Returns the capabilities
@@ -28,4 +28,7 @@ const capabilities = window._oc_capabilities || {}
*
* @since 14.0
*/
-export const getCapabilities = () => capabilities
+export const getCapabilities = () => {
+ console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities')
+ return realGetCapabilities()
+}
diff --git a/core/src/globals.js b/core/src/globals.js
index 275ea782d01..783c6556659 100644
--- a/core/src/globals.js
+++ b/core/src/globals.js
@@ -114,7 +114,6 @@ setDeprecatedProp('moment', () => moment, 'please ship your own, this will be re
window['OC'] = OC
setDeprecatedProp('initCore', () => initCore, 'this is an internal function')
setDeprecatedProp('oc_appswebroots', () => OC.appswebroots, 'use OC.appswebroots instead, this will be removed in Nextcloud 20')
-setDeprecatedProp('oc_capabilities', OC.getCapabilities, 'use OC.getCapabilities instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_config', () => OC.config, 'use OC.config instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_current_user', () => OC.getCurrentUser().uid, 'use OC.getCurrentUser().uid instead, this will be removed in Nextcloud 20')
setDeprecatedProp('oc_debug', () => OC.debug, 'use OC.debug instead, this will be removed in Nextcloud 20')