@7365admin1/layer-common 3.2.8-staging.213 → 3.2.8-staging.215

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.
@@ -348,7 +348,8 @@ const { getRoleById: _getRoleById, deleteRole } = useRole();
348
348
 
349
349
  const { data: role, refresh: getRoleById } = useLazyAsyncData(
350
350
  "role-permissions-get-by-id",
351
- () => _getRoleById(roleId.value)
351
+ () => _getRoleById(roleId.value),
352
+ { immediate: false }
352
353
  );
353
354
 
354
355
  watchEffect(() => {
@@ -2,7 +2,12 @@ import { useCommonPermissions } from "./useCommonPermission";
2
2
 
3
3
  export function useBulletinBoardPermission() {
4
4
  const { hasPermission } = usePermission();
5
- const { bulletinBoardPermissions: permissions } = useCommonPermissions();
5
+ // Same nesting rule as every other permission composable: `hasPermission`
6
+ // reads `catalogue[resource][action]`, and `bulletinBoardPermissions` is a
7
+ // flat `{action: ...}` map. Unwrapped, `catalogue["bulletin-board"]` was
8
+ // undefined and all five gates were reachable only through `"*"`.
9
+ const { bulletinBoardPermissions } = useCommonPermissions();
10
+ const permissions: TPermissions = { "bulletin-board": bulletinBoardPermissions };
6
11
 
7
12
  const { userAppRole } = useLocalSetup();
8
13
 
@@ -28,10 +28,6 @@ export default function useMember() {
28
28
  function getAllByUserId(user: string) {
29
29
  return useNuxtApp().$api<TMember>(`/api/members/users/${user}`);
30
30
  }
31
- function getByMemberId(user: string) {
32
- return useNuxtApp().$api<TMember>(`/api//user/${user}`);
33
- }
34
-
35
31
  function getByUserIdType(user: string, type: string) {
36
32
  return useNuxtApp().$api<TMember>(`/api/members/user/${user}/app/${type}`);
37
33
  }
@@ -165,7 +161,6 @@ export default function useMember() {
165
161
  createUserByVerification,
166
162
  createMemberInvite,
167
163
  getByUserIdType,
168
- getByMemberId,
169
164
  updateMemberStatus,
170
165
  updateMemberRole,
171
166
  createMemberDirect,
@@ -2,7 +2,13 @@ import { useCommonPermissions } from "./useCommonPermission";
2
2
 
3
3
  export function useSettingsPermission() {
4
4
  const { hasPermission } = usePermission();
5
- const { siteSettingsPermissions: permissions } = useCommonPermissions();
5
+ // `hasPermission` looks the action up as `catalogue[resource][action]`, so the
6
+ // catalogue has to be nested by resource. `siteSettingsPermissions` is a flat
7
+ // `{action: ...}` map, so passing it straight through made
8
+ // `catalogue["site-settings"]` undefined and every check below fell through to
9
+ // `false` -- only the `"*"` short-circuit could ever open a panel.
10
+ const { siteSettingsPermissions } = useCommonPermissions();
11
+ const permissions: TPermissions = { "site-settings": siteSettingsPermissions };
6
12
  const { userAppRole } = useLocalSetup();
7
13
 
8
14
  const canManageSiteInformation = computed(() => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.2.8-staging.213",
5
+ "version": "3.2.8-staging.215",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",