@axium/storage 0.20.4 → 0.20.5

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.
@@ -1,4 +1,4 @@
1
- import { getConfig } from '@axium/core';
1
+ import { checkACL, getConfig } from '@axium/core';
2
2
  import * as acl from '@axium/server/acl';
3
3
  import { audit } from '@axium/server/audit';
4
4
  import { requireSession } from '@axium/server/auth';
@@ -74,7 +74,7 @@ addRoute({
74
74
  continue;
75
75
  if (!item.acl || !item.acl.length)
76
76
  error(403, 'Missing permission for item: ' + item.id);
77
- acl.check(item.acl, changedIds.has(item.id) ? { write: true } : { manage: true });
77
+ checkACL(item.acl, changedIds.has(item.id) ? { write: true } : { manage: true });
78
78
  error(403, 'Missing permission for item: ' + item.id);
79
79
  }
80
80
  if (limits.user_size &&
package/lib/List.svelte CHANGED
@@ -123,18 +123,7 @@
123
123
  {@render action('download', 'download', i)}
124
124
  {@render action('trash', 'trash', i)}
125
125
  </div>
126
- <AccessControlDialog
127
- bind:dialog={dialogs['share:' + item.id]}
128
- {item}
129
- itemType="storage"
130
- editable={(item.acl?.find(
131
- a =>
132
- a.userId == user?.id ||
133
- (a.role && user?.roles.includes(a.role)) ||
134
- (a.tag && user?.tags?.includes(a.tag)) ||
135
- (!a.userId && !a.role && !a.tag)
136
- )?.manage as boolean | undefined) ?? true}
137
- />
126
+ <AccessControlDialog bind:dialog={dialogs['share:' + item.id]} {item} itemType="storage" {user} />
138
127
  </div>
139
128
  {:else}
140
129
  <p class="list-empty">{emptyText}</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/storage",
3
- "version": "0.20.4",
3
+ "version": "0.20.5",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "User file storage for Axium",
6
6
  "funding": {
@@ -40,8 +40,8 @@
40
40
  "build": "tsc"
41
41
  },
42
42
  "peerDependencies": {
43
- "@axium/client": ">=0.19.8",
44
- "@axium/core": ">=0.22.0",
43
+ "@axium/client": ">=0.20.0",
44
+ "@axium/core": ">=0.23.0",
45
45
  "@axium/server": ">=0.39.0",
46
46
  "@sveltejs/kit": "^2.27.3",
47
47
  "utilium": "^2.6.3"
@@ -33,18 +33,7 @@
33
33
  {text('page.files.restore')}
34
34
  </button>
35
35
  {:else}
36
- <AccessControlDialog
37
- bind:dialog={shareDialog}
38
- {item}
39
- itemType="storage"
40
- editable={(item.acl?.find(
41
- a =>
42
- a.userId == user?.id ||
43
- (a.role && user?.roles.includes(a.role)) ||
44
- (a.tag && user?.tags?.includes(a.tag)) ||
45
- (!a.userId && !a.role && !a.tag)
46
- )?.manage as boolean | undefined) ?? true}
47
- />
36
+ <AccessControlDialog bind:dialog={shareDialog} {item} itemType="storage" {user} />
48
37
  {#if item.parents}
49
38
  <p class="parents" data-sveltekit-reload>
50
39
  {#each item.parents as { id, name } (id)}<a href="/files/{id}">{name}</a>{/each}