From 5a537058eef32e9f045d94f7bf8c18cb7984a73b Mon Sep 17 00:00:00 2001 From: Sharon Stratsianis Date: Fri, 27 Nov 2026 13:38:54 +1100 Subject: [PATCH 1/2] change role names and add Admin --- src/acl/aclLogic.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/acl/aclLogic.ts b/src/acl/aclLogic.ts index b23ae5e..abd15b7 100644 --- a/src/acl/aclLogic.ts +++ b/src/acl/aclLogic.ts @@ -4,14 +4,9 @@ import type { AclLogic } from '../types' import { ns as namespace } from '../util/ns' import * as accessControlSubjects from './accessControlSubjects' -export const ACCESS_ROLES = ['Owner', 'Editor', 'No Access', 'Viewer', 'Poster', 'Submitter'] as const +export const ACCESS_ROLES = ['Owner', 'Admin', 'Editor', 'No Access', 'Viewer', 'Commenter', 'Appender'] as const export const PUBLIC_ACCESS_ROLES = ['No Access', 'Viewer'] as const -/** - * A Control grant without Write is the legacy "write locked" owner grant. - * - * It is intentionally not part of ACCESS_ROLES yet: that list is consumed by - * the existing UI, whose selector will be updated in a later change. - */ + export const WRITE_LOCKED_OWNER_ROLE = 'Owner (write locked)' as const export { Authenticated, Public } from '@dokieli/web-access-control' @@ -103,10 +98,10 @@ export function createAclLogic(store): AclLogic { const ns = namespace const ACCESS_ROLE_RULES: Array<{ label: AccessRole, modes: AccessMode[] }> = [ { label: 'Owner', modes: ['Read', 'Write', 'Control'] }, - { label: WRITE_LOCKED_OWNER_ROLE, modes: ['Read', 'Control'] }, + { label: 'Admin', modes: ['Read', 'Control'] }, { label: 'Editor', modes: ['Read', 'Write'] }, - { label: 'Poster', modes: ['Append', 'Read'] }, - { label: 'Submitter', modes: ['Append'] }, + { label: 'Commenter', modes: ['Append', 'Read'] }, + { label: 'Appender', modes: ['Append'] }, { label: 'Viewer', modes: ['Read'] }, { label: 'No Access', modes: [] } ] From 78eba5e68733ba5ce9e87ab7b09d02823f96860f Mon Sep 17 00:00:00 2001 From: Sharon Stratsianis Date: Fri, 27 Nov 2026 13:40:00 +1100 Subject: [PATCH 2/2] update version --- package-lock.json | 105 ++++++++++++++------------------------ package.json | 2 +- test/aclLogic.test.ts | 9 ++-- test/publicAclApi.test.ts | 2 +- 4 files changed, 43 insertions(+), 75 deletions(-) diff --git a/package-lock.json b/package-lock.json index 447785d..1720ea8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "solid-logic", - "version": "6.2.1-0", + "version": "6.2.1-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "solid-logic", - "version": "6.2.1-0", + "version": "6.2.1-1", "license": "MIT", "dependencies": { "@dokieli/web-access-control": "^1.1.0", @@ -2552,9 +2552,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2572,9 +2569,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2592,9 +2586,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2612,9 +2603,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2632,9 +2620,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2652,9 +2637,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4425,9 +4407,9 @@ "license": "ISC" }, "node_modules/enhanced-resolve": { - "version": "5.26.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.1.tgz", - "integrity": "sha512-PPnnSJq3azKOIewXR/uppBV/6h98dprBJ/WaQ9Qgj10xX1lJLNfg+XShpbsrSqcDSy2yYYyhfXM1wWhftqgyzw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.0.tgz", + "integrity": "sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ==", "dev": true, "license": "MIT", "peer": true, @@ -5461,11 +5443,11 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "peer": true }, "node_modules/has-bigints": { @@ -6533,9 +6515,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6557,9 +6536,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6581,9 +6557,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6605,9 +6578,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -6869,15 +6839,15 @@ } }, "node_modules/minimizer-webpack-plugin": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.0.tgz", - "integrity": "sha512-PnvQXCJxhgH2ZVVO7Lj0sM6q8L1XGxnUvd8wVQIRwi8khMCLq5wg0Ngxe44bcuZL2FSN81RdVE7YHEVzTKsQDQ==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.1.tgz", + "integrity": "sha512-qsfTb5Ao4nre9krFweqj8k5bVU7KxgsP4WkLO/ITTuiJkbitCzYBY+Aum5KTKRhY0wDr8VJ1RILsTCSUtPd1kQ==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "jest-worker": "^27.4.5", - "schema-utils": "^4.6.0", + "schema-utils": "^4.8.5", "terser": "^5.51.0" }, "engines": { @@ -7885,9 +7855,9 @@ } }, "node_modules/schema-utils": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.3.tgz", - "integrity": "sha512-qIfo3f+lRNqnMPgpXSKvUhsT3pY5U+ppmgGr4j8LanFP3W/Ze+xj8DY/dPb5qVu3m6qFIMyMWKVRLNKxrNhxWg==", + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.5.tgz", + "integrity": "sha512-K1RRP7aTUAY2lGXNzPwjMK6AMMzbETdpF3pTPMEnH/RrpmPx6K1X47/gSebrV+1I9pRcgpwZwqpYBlyZAsliiw==", "dev": true, "license": "MIT", "peer": true, @@ -8373,9 +8343,9 @@ "license": "MIT" }, "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", "dev": true, "license": "MIT", "peer": true, @@ -8388,9 +8358,9 @@ } }, "node_modules/terser": { - "version": "5.51.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", - "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "version": "5.51.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.4.tgz", + "integrity": "sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -9168,9 +9138,9 @@ } }, "node_modules/watchpack": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.3.tgz", - "integrity": "sha512-s3NZy0QpTY9qGqzc0wtz4qI28z3+5qKbbAec4MV4G9N3CfgZ9wgvQRr0cl2jh/tqkWG1NWHkmVMHZpCamev5Wg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.4.tgz", + "integrity": "sha512-5H3Tce2GfzWbcr9VnSqyak2whFaONw4BdmI5BDnMXold4qSlCFd64XaMQESRh2vkDKmdUkv6rUo17UvZ9f9nXw==", "dev": true, "license": "MIT", "peer": true, @@ -9192,9 +9162,9 @@ } }, "node_modules/webpack": { - "version": "5.112.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.2.tgz", - "integrity": "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g==", + "version": "5.113.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.113.0.tgz", + "integrity": "sha512-q54iF0LNaAAdLEt3al9qMXC2zARvcx7LVKjHp+ExjCRkGx0M8TmawGHAXykXwofWzxhNzPTAh3kLVXvNg0El4A==", "dev": true, "license": "MIT", "peer": true, @@ -9206,16 +9176,15 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.26.0", - "es-module-lexer": "^2.1.0", + "enhanced-resolve": "^5.27.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", - "minimizer-webpack-plugin": "^5.13.0", - "schema-utils": "^4.8.1", - "tapable": "^2.3.0", - "watchpack": "^2.6.3", - "webpack-sources": "^3.6.0" + "minimizer-webpack-plugin": "^5.14.0", + "schema-utils": "^4.8.2", + "tapable": "^2.3.4", + "watchpack": "^2.6.4", + "webpack-sources": "^3.7.1" }, "bin": { "webpack": "bin/webpack.js" @@ -9234,9 +9203,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.7.0.tgz", - "integrity": "sha512-PdUhbCycwEgiS1hB/FBDksWKg/ashAIuJKqwdbPn8/dFVgU5LxQiBvG0js6VRRIzPujMrStYCczywp82P0KWng==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.7.1.tgz", + "integrity": "sha512-mcxs7A2LsEdwsNqQburqS4QHPR2Ca3NGplUakn6J5GPQvnVZ4oD4IM4FJcT3f8AVN2e2EsjuIVxKj4rorHvyuQ==", "dev": true, "license": "MIT", "peer": true, diff --git a/package.json b/package.json index e7c83e9..7d4e69e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "solid-logic", - "version": "6.2.1-0", + "version": "6.2.1-1", "description": "Core business logic of SolidOS", "main": "dist/index.cjs.js", "module": "dist/index.esm.js", diff --git a/test/aclLogic.test.ts b/test/aclLogic.test.ts index 4ecd702..3ba8380 100644 --- a/test/aclLogic.test.ts +++ b/test/aclLogic.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { Fetcher, Store, literal, namedNode, sym, UpdateManager } from 'rdflib' import { ACL, applyPlan, buildACLContext, findEffectiveACL, parseTurtle, planGrant, planPublicRead, planRevoke, Public, quad, type PatchPlan, type Quad } from '@dokieli/web-access-control' -import { ACL_LINK, WRITE_LOCKED_OWNER_ROLE, analyzeContainerAccessScope, classifyAuthorizationScope, classifyContainerAccessScope, createAclLogic, filterAuthorizationsByContainerScope } from '../src/acl/aclLogic' +import { ACL_LINK, analyzeContainerAccessScope, classifyAuthorizationScope, classifyContainerAccessScope, createAclLogic, filterAuthorizationsByContainerScope } from '../src/acl/aclLogic' var actualFindEffectiveACL: typeof findEffectiveACL var actualPlanGrant: typeof planGrant @@ -165,16 +165,15 @@ describe('createAclLogic', () => { it('maps roles to ACL modes and back', () => { expect(aclLogic.modesFromRole('Editor')).toEqual(['Read', 'Write']) expect(aclLogic.modesFromRole('Owner')).toEqual(['Read', 'Write', 'Control']) - expect(aclLogic.modesFromRole(WRITE_LOCKED_OWNER_ROLE)).toEqual(['Read', 'Control']) expect(aclLogic.modesFromRole('No Access')).toEqual([]) expect(aclLogic.roleFromModes(['Read', 'Write'])).toBe('Editor') expect(aclLogic.roleFromModes(['Read'])).toBe('Viewer') - expect(aclLogic.roleFromModes(['Control', 'Read'])).toBe(WRITE_LOCKED_OWNER_ROLE) + expect(aclLogic.roleFromModes(['Control', 'Read'])).toBe('Admin') expect(aclLogic.roleFromModes(['Read', 'Write', 'Control', 'Append'])).toBe('No Access') expect(aclLogic.roleFromModes([])).toBe('No Access') }) - it('preserves write-locked owner modes in a grant plan', async () => { + it('plans admin modes without write access', async () => { const resource = 'https://example.com/write-locked.ttl' const ownACL = `@prefix acl: <${ACL}>. <#existing> a acl:Authorization; @@ -184,7 +183,7 @@ describe('createAclLogic', () => { const plan = await sharingLogic(resource, ownACL).planGrant(resource, { type: 'agent', iri: 'https://example.com/profile/card#owner' - }, aclLogic.modesFromRole(WRITE_LOCKED_OWNER_ROLE)) + }, aclLogic.modesFromRole('Admin')) expect(plan.inserts .filter(statement => statement.predicate.value === ACL + 'mode') diff --git a/test/publicAclApi.test.ts b/test/publicAclApi.test.ts index 8b5fd2e..4447937 100644 --- a/test/publicAclApi.test.ts +++ b/test/publicAclApi.test.ts @@ -19,7 +19,7 @@ import { describe('public ACL API', () => { it('exports the role list and exposes mapping through the singleton', () => { - expect(ACCESS_ROLES).toEqual(['Owner', 'Editor', 'No Access', 'Viewer', 'Poster', 'Submitter']) + expect(ACCESS_ROLES).toEqual(['Owner', 'Admin', 'Editor', 'No Access', 'Viewer', 'Commenter', 'Appender']) expect(PUBLIC_ACCESS_ROLES).toEqual(['No Access', 'Viewer']) expect(WRITE_LOCKED_OWNER_ROLE).toBe('Owner (write locked)') expect(Authenticated).toMatchObject({ type: 'agentClass', iri: 'http://www.w3.org/ns/auth/acl#AuthenticatedAgent' })