@acms-subir/core 0.3.20 → 0.3.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @acms-subir/core
2
2
 
3
+ ## 0.3.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 6096e7c: Fix the Live video, Mobile app and Email admin pages refusing owners who opened them from a link on another site or app. These pages ran the API's cross-site check and then reported every failure as a missing "Connected services" permission (Email: "Only owners can manage email"). They now check only the person's role, like the other admin pages. The admin APIs still refuse cross-site calls.
8
+
3
9
  ## 0.3.20
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acms-subir/core",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -2,10 +2,10 @@
2
2
  import Admin from '../../layouts/Admin.astro';
3
3
  import EmailSettings from '../../components/EmailSettings';
4
4
  import { getRepo } from '../../lib/repo';
5
- import { requirePermission } from '../../lib/permissions/access';
5
+ import { forbiddenUnless } from '../../lib/permissions/access';
6
6
  const repo=await getRepo(Astro.locals);
7
- try { await requirePermission(Astro.request, Astro.cookies, repo, 'services.manage'); }
8
- catch { return new Response('Only owners can manage email.',{status:403}); }
7
+ const denied = await forbiddenUnless(Astro.request, Astro.cookies, repo, 'services.manage');
8
+ if (denied) return denied;
9
9
  ---
10
10
  <Admin title="Email" section="settings">
11
11
  <div class="page-head"><h1>Email</h1><a class="btn ghost" href="/admin/settings">Site settings</a></div>
@@ -2,10 +2,10 @@
2
2
  import Admin from '../../layouts/Admin.astro';
3
3
  import LiveManager from '../../components/LiveManager';
4
4
  import { getRepo } from '../../lib/repo';
5
- import { requirePermission } from '../../lib/permissions/access';
5
+ import { forbiddenUnless } from '../../lib/permissions/access';
6
6
  const repo = await getRepo(Astro.locals);
7
- try { await requirePermission(Astro.request, Astro.cookies, repo, 'services.manage'); }
8
- catch { return new Response('Your role doesn’t include “Connected services”.', { status: 403 }); }
7
+ const denied = await forbiddenUnless(Astro.request, Astro.cookies, repo, 'services.manage');
8
+ if (denied) return denied;
9
9
  ---
10
10
  <Admin title="Live video" section="integrations">
11
11
  <LiveManager client:only="react" />
@@ -3,11 +3,11 @@ import Admin from '../../layouts/Admin.astro';
3
3
  import AppAccess from '../../components/AppAccess';
4
4
  import MobileApp from '../../components/MobileApp';
5
5
  import { getRepo } from '../../lib/repo';
6
- import { requirePermission } from '../../lib/permissions/access';
6
+ import { forbiddenUnless } from '../../lib/permissions/access';
7
7
  import { PUSH } from '../../lib/push/config';
8
8
  const repo = await getRepo(Astro.locals);
9
- try { await requirePermission(Astro.request, Astro.cookies, repo, 'services.manage'); }
10
- catch { return new Response('Your role doesn’t include “Connected services”.', { status: 403 }); }
9
+ const denied = await forbiddenUnless(Astro.request, Astro.cookies, repo, 'services.manage');
10
+ if (denied) return denied;
11
11
  ---
12
12
  <Admin title="Mobile app" section="mobile">
13
13
  <div class="page-head">