aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/utils/userUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src/utils/userUtils.ts')
-rw-r--r--apps/settings/src/utils/userUtils.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/settings/src/utils/userUtils.ts b/apps/settings/src/utils/userUtils.ts
new file mode 100644
index 00000000000..7d9a516a542
--- /dev/null
+++ b/apps/settings/src/utils/userUtils.ts
@@ -0,0 +1,27 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import { translate as t } from '@nextcloud/l10n'
+
+export const unlimitedQuota = {
+ id: 'none',
+ label: t('settings', 'Unlimited'),
+}
+
+export const defaultQuota = {
+ id: 'default',
+ label: t('settings', 'Default quota'),
+}
+
+/**
+ * Return `true` if the logged in user does not have permissions to view the
+ * data of `user`
+ * @param user The user to check
+ * @param user.id Id of the user
+ */
+export const isObfuscated = (user: { id: string, [key: string]: unknown }) => {
+ const keys = Object.keys(user)
+ return keys.length === 1 && keys.at(0) === 'id'
+}