Skip to content

Commit a6bc4cd

Browse files
committed
fix: replace access level with warning if admin mode
1 parent 99a262e commit a6bc4cd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/auth/SharingPanel.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { PhShareNetwork } from "@phosphor-icons/vue";
33
import { computedAsync } from "@vueuse/core";
44
import UrlButton from "@/components/UrlButton.vue";
5+
import useAdmin from "@/user/admin.composable";
56
import { useAuth } from "@/auth/auth.composable";
67
import { getAuthGuiUrl, type ResourceType } from "@/api/sbauth";
78
import { useResourceStore } from "@/store/resource.store";
@@ -13,6 +14,7 @@ const props = defineProps<{
1314
}>();
1415
1516
const store = useResourceStore();
17+
const { adminMode } = useAdmin();
1618
const { getAccessLevel } = useAuth();
1719
1820
const resource = computedAsync(() => store.loadResource(props.resourceId));
@@ -33,7 +35,13 @@ const resource = computedAsync(() => store.loadResource(props.resourceId));
3335
<th>{{ $t("sharing.level") }}</th>
3436
<td class="flex gap-3 items-baseline">
3537
<div>
36-
<TerminalOutput class="inline leading-loose">
38+
<span
39+
v-if="adminMode"
40+
class="bg-amber-300 text-amber-900 px-2 py-1"
41+
>
42+
{{ $t("sharing.level.admin_mode") }}
43+
</span>
44+
<TerminalOutput v-else class="inline leading-loose">
3745
{{ getAccessLevel(resourceType, resourceId) }}
3846
</TerminalOutput>
3947
</div>

src/i18n/locales/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ job.process.korp: Installation to Korp
8383
job.process.strix: Installation to Strix
8484
sharing: Sharing
8585
sharing.level: Your access level
86+
sharing.level.admin_mode: Admin mode enabled
8687
sharing.manage: Manage access
8788
sharing.owner: Owner
8889
sharing.help.heading: About access management

src/i18n/locales/sv.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ job.process.korp: Installation i Korp
8484
job.process.strix: Installation i Strix
8585
sharing: Delning
8686
sharing.level: Din behörighetsnivå
87+
sharing.level.admin_mode: Administratörsläge aktiverat
8788
sharing.manage: Hantera åtkomst
8889
sharing.owner: Ägare
8990
sharing.help.heading: Om åtkomsthantering

0 commit comments

Comments
 (0)