From 2ba5a9ba7683db30c42d92e75e23587a9063ea7f Mon Sep 17 00:00:00 2001 From: NaderMohamed325 Date: Tue, 28 Jul 2026 15:15:29 +0300 Subject: [PATCH 1/2] Remove unused resource parameter from getPermissionsFor --- lib/header.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/header.mjs b/lib/header.mjs index ed748623e..1d4fabfc5 100644 --- a/lib/header.mjs +++ b/lib/header.mjs @@ -119,8 +119,8 @@ export async function addPermissions (req, res, next) { const ldp = req.app.locals.ldp const resource = ldp.resourceMapper.resolveUrl(req.hostname, req.path) let [publicPerms, userPerms] = await Promise.all([ - getPermissionsFor(acl, null, req), - getPermissionsFor(acl, session.userId, req) + getPermissionsFor(acl, null), + getPermissionsFor(acl, session.userId) ]) if (resource.endsWith('.acl') && userPerms === '' && await ldp.isOwner(session.userId, req.hostname)) userPerms = 'control' debug.ACL(`Permissions on ${resource} for ${session.userId || '(none)'}: ${userPerms}`) @@ -131,7 +131,7 @@ export async function addPermissions (req, res, next) { } // Gets the permissions string for the given user and resource -async function getPermissionsFor (acl, user, req) { +async function getPermissionsFor (acl, user) { const accesses = MODES.map(mode => acl.can(user, mode)) const allowed = await Promise.all(accesses) return PERMISSIONS.filter((mode, i) => allowed[i]).join(' ') From 993019017f37a1e43ac3057ddef886e316f9442e Mon Sep 17 00:00:00 2001 From: Nader Mohamed Nader Date: Tue, 28 Jul 2026 15:21:07 +0300 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/header.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/header.mjs b/lib/header.mjs index 1d4fabfc5..c3d418c1a 100644 --- a/lib/header.mjs +++ b/lib/header.mjs @@ -130,7 +130,7 @@ export async function addPermissions (req, res, next) { next() } -// Gets the permissions string for the given user and resource +// Gets the permissions string for the given user async function getPermissionsFor (acl, user) { const accesses = MODES.map(mode => acl.can(user, mode)) const allowed = await Promise.all(accesses)