@abraca/nuxt 2.60.0 → 2.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
- package/dist/runtime/components/renderers/AGraphRenderer.vue +1 -0
- package/dist/runtime/composables/useDocPermissions.js +8 -7
- package/dist/runtime/composables/useDocumentPermissions.js +3 -1
- package/dist/runtime/plugin-abracadabra.client.js +6 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
awareness: boolean;
|
|
13
13
|
tag: "video" | "audio";
|
|
14
14
|
live: boolean;
|
|
15
|
-
controls: boolean;
|
|
16
15
|
total: boolean;
|
|
16
|
+
controls: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
awareness: boolean;
|
|
13
13
|
tag: "video" | "audio";
|
|
14
14
|
live: boolean;
|
|
15
|
-
controls: boolean;
|
|
16
15
|
total: boolean;
|
|
16
|
+
controls: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
@@ -750,6 +750,7 @@ const batchedEdgePaths = computed(() => {
|
|
|
750
750
|
});
|
|
751
751
|
let savePosTimer = null;
|
|
752
752
|
function savePositionsDebounced() {
|
|
753
|
+
if (!canWrite.value) return;
|
|
753
754
|
if (savePosTimer) clearTimeout(savePosTimer);
|
|
754
755
|
savePosTimer = setTimeout(() => {
|
|
755
756
|
savePosTimer = null;
|
|
@@ -20,7 +20,7 @@ const DEFAULT_LABELS = {
|
|
|
20
20
|
roleViewer: "Viewer",
|
|
21
21
|
roleObserver: "Observer"
|
|
22
22
|
};
|
|
23
|
-
const ROLE_RANK = { observer: 0, viewer: 1, editor: 2, owner: 3 };
|
|
23
|
+
const ROLE_RANK = { observer: 0, viewer: 1, editor: 2, owner: 3, admin: 4, service: 5 };
|
|
24
24
|
export function roleMax(a, b) {
|
|
25
25
|
return (ROLE_RANK[a] ?? -1) >= (ROLE_RANK[b] ?? -1) ? a : b;
|
|
26
26
|
}
|
|
@@ -54,13 +54,14 @@ export function useDocPermissions(docId, options) {
|
|
|
54
54
|
const pub = docAccess.value?.public_access ?? docAccess.value?.effective_public_access;
|
|
55
55
|
const publicFloor = pub && pub !== "none" ? pub : null;
|
|
56
56
|
const def = serverDefaultRole.value || null;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
return def ?? providerRole.value ?? null;
|
|
57
|
+
const cascaded = explicit && publicFloor ? roleMax(explicit, publicFloor) : explicit ?? (publicFloor && def ? roleMax(publicFloor, def) : publicFloor ?? def ?? null);
|
|
58
|
+
const provider = providerRole.value;
|
|
59
|
+
if (cascaded && provider) return roleMax(cascaded, provider);
|
|
60
|
+
return cascaded ?? provider ?? null;
|
|
62
61
|
});
|
|
63
|
-
const isOwner = computed(
|
|
62
|
+
const isOwner = computed(
|
|
63
|
+
() => (ROLE_RANK[effectiveRole.value ?? ""] ?? -1) >= ROLE_RANK.owner
|
|
64
|
+
);
|
|
64
65
|
const directPermissions = computed(() => permissions.value.filter((p) => p.source === "direct"));
|
|
65
66
|
const inheritedPermissions = computed(() => permissions.value.filter((p) => p.source === "inherited"));
|
|
66
67
|
const hasInheritedPermissions = computed(() => inheritedPermissions.value.length > 0);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { computed, toValue } from "vue";
|
|
2
2
|
const ROLE_HIERARCHY = {
|
|
3
|
+
service: 6,
|
|
3
4
|
owner: 5,
|
|
4
5
|
admin: 4,
|
|
5
6
|
member: 3,
|
|
6
7
|
editor: 2,
|
|
7
|
-
viewer: 1
|
|
8
|
+
viewer: 1,
|
|
9
|
+
observer: 0
|
|
8
10
|
};
|
|
9
11
|
export function useDocumentPermissions(role) {
|
|
10
12
|
const level = computed(() => ROLE_HIERARCHY[toValue(role) ?? ""] ?? 0);
|
|
@@ -1447,6 +1447,7 @@ export default defineNuxtPlugin({
|
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
try {
|
|
1450
|
+
if (!_provider.canWrite) throw new Error("read-only session");
|
|
1450
1451
|
const trashMap = _doc.getMap("doc-trash");
|
|
1451
1452
|
const settings = (() => {
|
|
1452
1453
|
try {
|
|
@@ -1479,8 +1480,12 @@ export default defineNuxtPlugin({
|
|
|
1479
1480
|
authFailureCount = 0;
|
|
1480
1481
|
},
|
|
1481
1482
|
onAuthenticationFailed({ reason }) {
|
|
1482
|
-
authFailureCount++;
|
|
1483
1483
|
const msg = reason || "Authentication failed";
|
|
1484
|
+
if (/write permission denied|not subscribed/i.test(msg)) {
|
|
1485
|
+
addLog(`Write dropped (read-only session): ${msg}`, "auth");
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
authFailureCount++;
|
|
1484
1489
|
const isPermanent = /disabled|not allowed|forbidden|revoked/i.test(msg);
|
|
1485
1490
|
if (isPermanent || authFailureCount >= AUTH_FAILURE_LIMIT) {
|
|
1486
1491
|
_identityStateBeforeBlock = identityState.value;
|