aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/src/components/SharingInput.vue7
-rw-r--r--apps/files_sharing/src/services/ConfigService.js9
-rw-r--r--apps/files_sharing/src/views/SharingLinkList.vue4
-rw-r--r--apps/settings/src/store/users.js7
4 files changed, 16 insertions, 11 deletions
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue
index 8c4605cc75a..2a02af1be0f 100644
--- a/apps/files_sharing/src/components/SharingInput.vue
+++ b/apps/files_sharing/src/components/SharingInput.vue
@@ -46,6 +46,7 @@
<script>
import { generateOcsUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
+import { getCapabilities } from '@nextcloud/capabilities'
import axios from '@nextcloud/axios'
import debounce from 'debounce'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
@@ -175,7 +176,7 @@ export default {
async getSuggestions(search, lookup = false) {
this.loading = true
- if (OC.getCapabilities().files_sharing.sharee.query_lookup_default === true) {
+ if (getCapabilities().files_sharing.sharee.query_lookup_default === true) {
lookup = true
}
@@ -191,7 +192,7 @@ export default {
this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH,
]
- if (OC.getCapabilities().files_sharing.public.enabled === true) {
+ if (getCapabilities().files_sharing.public.enabled === true) {
shareType.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL)
}
@@ -499,7 +500,7 @@ export default {
shareType: value.shareType,
shareWith: value.shareWith,
password,
- permissions: this.fileInfo.sharePermissions & OC.getCapabilities().files_sharing.default_permissions,
+ permissions: this.fileInfo.sharePermissions & getCapabilities().files_sharing.default_permissions,
attributes: JSON.stringify(this.fileInfo.shareAttributes),
})
diff --git a/apps/files_sharing/src/services/ConfigService.js b/apps/files_sharing/src/services/ConfigService.js
index 39062d64846..d1d99e7be7a 100644
--- a/apps/files_sharing/src/services/ConfigService.js
+++ b/apps/files_sharing/src/services/ConfigService.js
@@ -23,6 +23,7 @@
*/
import { loadState } from '@nextcloud/initial-state'
+import { getCapabilities } from '@nextcloud/capabilities'
export default class Config {
@@ -213,7 +214,7 @@ export default class Config {
* @memberof Config
*/
get isMailShareAllowed() {
- const capabilities = OC.getCapabilities()
+ const capabilities = getCapabilities()
// eslint-disable-next-line camelcase
return capabilities?.files_sharing?.sharebymail !== undefined
// eslint-disable-next-line camelcase
@@ -272,7 +273,7 @@ export default class Config {
* @memberof Config
*/
get isPasswordForMailSharesRequired() {
- return (OC.getCapabilities().files_sharing.sharebymail === undefined) ? false : OC.getCapabilities().files_sharing.sharebymail.password.enforced
+ return (getCapabilities().files_sharing.sharebymail === undefined) ? false : getCapabilities().files_sharing.sharebymail.password.enforced
}
/**
@@ -281,7 +282,7 @@ export default class Config {
* @memberof Config
*/
get shouldAlwaysShowUnique() {
- return (OC.getCapabilities().files_sharing?.sharee?.always_show_unique === true)
+ return (getCapabilities().files_sharing?.sharee?.always_show_unique === true)
}
/**
@@ -326,7 +327,7 @@ export default class Config {
* @memberof Config
*/
get passwordPolicy() {
- const capabilities = OC.getCapabilities()
+ const capabilities = getCapabilities()
return capabilities.password_policy ? capabilities.password_policy : {}
}
diff --git a/apps/files_sharing/src/views/SharingLinkList.vue b/apps/files_sharing/src/views/SharingLinkList.vue
index 899424be1d8..462d38fe8ad 100644
--- a/apps/files_sharing/src/views/SharingLinkList.vue
+++ b/apps/files_sharing/src/views/SharingLinkList.vue
@@ -46,6 +46,8 @@
</template>
<script>
+import { getCapabilities } from '@nextcloud/capabilities'
+
// eslint-disable-next-line no-unused-vars
import Share from '../models/Share.js'
import ShareTypes from '../mixins/ShareTypes.js'
@@ -80,7 +82,7 @@ export default {
data() {
return {
- canLinkShare: OC.getCapabilities().files_sharing.public.enabled,
+ canLinkShare: getCapabilities().files_sharing.public.enabled,
}
},
diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js
index e6b8bba8fc1..b031f768fd1 100644
--- a/apps/settings/src/store/users.js
+++ b/apps/settings/src/store/users.js
@@ -30,6 +30,7 @@
import api from './api.js'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
+import { getCapabilities } from '@nextcloud/capabilities'
import logger from '../logger.js'
const orderGroups = function(groups, orderBy) {
@@ -428,9 +429,9 @@ const actions = {
},
getPasswordPolicyMinLength(context) {
- if (OC.getCapabilities().password_policy && OC.getCapabilities().password_policy.minLength) {
- context.commit('setPasswordPolicyMinLength', OC.getCapabilities().password_policy.minLength)
- return OC.getCapabilities().password_policy.minLength
+ if (getCapabilities().password_policy && getCapabilities().password_policy.minLength) {
+ context.commit('setPasswordPolicyMinLength', getCapabilities().password_policy.minLength)
+ return getCapabilities().password_policy.minLength
}
return false
},