From 13b8437a658c818be0e585d39ff49be408fdc7e7 Mon Sep 17 00:00:00 2001 From: Jess Moore Date: Thu, 15 Jan 2026 15:02:09 +1100 Subject: [PATCH 1/5] added prints --- lib/src/solid/grant_permission.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/solid/grant_permission.dart b/lib/src/solid/grant_permission.dart index a1491ce1..b7274648 100644 --- a/lib/src/solid/grant_permission.dart +++ b/lib/src/solid/grant_permission.dart @@ -109,8 +109,14 @@ Future grantPermission({ final resStatus = await checkResourceStatus(resourceUrl, isFile: isFile); // Check if recipient/s have initialised their pods with the correct - // directory structure - var allRecipientsInitialised = true; + // directory structure - required to access the shared resource + bool allRecipientsInitialised = true; + debugPrint( + 'grantPermission(): recipienttype: ${recipientType.description.toString()}', + ); + debugPrint( + 'grantPermission(): webids: ${recipientWebIdList.toString()}', + ); for (final recipientWebId in recipientWebIdList) { final isInitialised = await checkPodInitialised(recipientWebId as String); @@ -191,6 +197,7 @@ Future grantPermission({ } } + // TODO: check logs written for public and auth sharing // 20260112 jesscmoore: the permission logs are not updated if // permission granted is to give public access or give access //to all authenticated users. From 68494822808de0d2fae7dfa53295b982bd8e0219 Mon Sep 17 00:00:00 2001 From: Jess Moore Date: Thu, 15 Jan 2026 22:05:10 +1100 Subject: [PATCH 2/5] fix key file creation for sharing to public/auth --- lib/src/solid/api/grant_permission_api.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/solid/api/grant_permission_api.dart b/lib/src/solid/api/grant_permission_api.dart index 70a97c91..f5e09bf1 100644 --- a/lib/src/solid/api/grant_permission_api.dart +++ b/lib/src/solid/api/grant_permission_api.dart @@ -289,7 +289,7 @@ Future copySharedKeyUserClass( } // Check if individual key file exists. If not create a file - if (await checkResourceStatus(userClassIndKeyFileUrl, isFile: false) == + if (await checkResourceStatus(userClassIndKeyFileUrl, isFile: true) == ResourceStatus.notExist) { // If file does not exist create a ttl file final userClassIndKeyFileContent = await genUserClassIndKeyTTLStr([ From 92717f87ac7f226426d851a4e1ded602ef645790 Mon Sep 17 00:00:00 2001 From: Jess Moore Date: Thu, 15 Jan 2026 22:15:23 +1100 Subject: [PATCH 3/5] fix key file creation for revoking access to public/auth --- lib/src/solid/api/revoke_permission_api.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/solid/api/revoke_permission_api.dart b/lib/src/solid/api/revoke_permission_api.dart index 30a26141..1dba10fb 100644 --- a/lib/src/solid/api/revoke_permission_api.dart +++ b/lib/src/solid/api/revoke_permission_api.dart @@ -215,7 +215,7 @@ Future removeSharedKeyUserClass( } // Check if individual key file exists. If not create a file - if (await checkResourceStatus(userClassIndKeyFileUrl, isFile: false) == + if (await checkResourceStatus(userClassIndKeyFileUrl, isFile: true) == ResourceStatus.exist) { // Update the existing file using a sparql query final prefix = '${solidTermsNS.prefix}: <$appsTerms>'; From b451b82d9cf5194095caa57993d045a0ad2a1433 Mon Sep 17 00:00:00 2001 From: Jess Moore Date: Thu, 15 Jan 2026 22:19:59 +1100 Subject: [PATCH 4/5] only check pod initialised if sharing to specific recipients --- lib/src/solid/grant_permission.dart | 49 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/lib/src/solid/grant_permission.dart b/lib/src/solid/grant_permission.dart index 5a843133..9751aaee 100644 --- a/lib/src/solid/grant_permission.dart +++ b/lib/src/solid/grant_permission.dart @@ -112,21 +112,21 @@ Future grantPermission({ // Check if recipient/s have initialised their pods with the correct // directory structure - required to access the shared resource bool allRecipientsInitialised = true; - debugPrint( - 'grantPermission(): recipienttype: ${recipientType.description.toString()}', - ); - debugPrint( - 'grantPermission(): webids: ${recipientWebIdList.toString()}', - ); - for (final recipientWebId in recipientWebIdList) { - final isInitialised = - await checkPodInitialised(recipientWebId as String); - if (!isInitialised) { - allRecipientsInitialised = false; + bool hasSpecificRecipients = false; + if (specificRecipientTypeList.contains(recipientType)) { + hasSpecificRecipients = true; + for (final recipientWebId in recipientWebIdList) { + final isInitialised = + await checkPodInitialised(recipientWebId as String); + if (!isInitialised) { + allRecipientsInitialised = false; + } } } - if (allRecipientsInitialised) { + // Where recipient is specific recipient, only assign access + // if recipient pods have been initialised + if (allRecipientsInitialised || !hasSpecificRecipients) { if (resStatus == ResourceStatus.exist) { // Add the permission line to the relevant ACL file await setPermissionAcl( @@ -152,7 +152,7 @@ Future grantPermission({ : await KeyManager.getIndividualKey(resourceUrl); // If permission granted to specific recipients - if (specificRecipientTypeList.contains(recipientType)) { + if (hasSpecificRecipients) { // For each recipient share the individual encryption key for (final recipientWebId in recipientWebIdList) { @@ -198,14 +198,8 @@ Future grantPermission({ } } - // TODO: check logs written for public and auth sharing - // 20260112 jesscmoore: the permission logs are not updated if - // permission granted is to give public access or give access - //to all authenticated users. - - // Add log entry to owner, granter, and receiver permission log - // files for the individual recipient or each recipient in the - // recipient group. + // 20260112 jesscmoore: the permission logs should be updated + // for granting access to public, auth users, and specific recipients. for (final recipientWebId in recipientWebIdList) { final LogEntry logEntryRes = createPermLogEntry( @@ -228,14 +222,17 @@ Future grantPermission({ final granterLogFileUrl = await getFileUrl(logFilePath, webId: granterWebId); - // Run log entry insert query for the granter + // Add log entry to owner, granter, and receiver permission + // log files for the individual recipient or each recipient + // in the recipient group. + + // Update granter log await addPermLogLine( logFileUrl: granterLogFileUrl, logEntry: logEntryRes, ); - // If owner and the granter is not the same add another log file entry - // for the owner + // Upddate owner log (if owner != granter) if (ownerLogFileUrl != granterLogFileUrl) { await addPermLogLine( logFileUrl: ownerLogFileUrl, @@ -243,8 +240,8 @@ Future grantPermission({ ); } - // Add log entry if the recipient is either an individual or group of WebIDs - if (specificRecipientTypeList.contains(recipientType)) { + // Update recipient logs if the recipient is either an individual or group of WebIDs + if (hasSpecificRecipients) { final receiverLogFileUrl = await getFileUrl(logFilePath, webId: recipientWebId); From fff26701adef9723b5d9213894537dbf9b0eb3ca Mon Sep 17 00:00:00 2001 From: Jess Moore Date: Thu, 15 Jan 2026 22:30:27 +1100 Subject: [PATCH 5/5] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b45517..194e878b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Visit the package at [pub.dev](https://pub.dev/packages/solidpod). ## 0.10 Further UI migrations ++ Fixed sharing to public/auth users bug [0.9.9 20260115 jesscmoore] + Support custom folder structure [0.9.8 20260114 anushkavid] + Restore individual recipient suggestions [0.9.7 20260113 jesscmoore] + Allow sharing externally owned files [0.9.6 20260110 jesscmoore]