Closed jaxoncreed closed 3 years ago
Thanks for reporting this @jaxoncreed. One thing that stands out to me is that your setAcl
function is always creating a new ACL with createAcl
, even though you've already verified that one exists with hasResourceAcl
. Could you try replacing the call to createAcl
with getResourceAcl
and report back if that fixes it? Thanks!
Yep that was it! Sorry about that. This worked:
let resourceAcl = hasResourceAcl(myDatasetWithAcl) ?
getResourceAcl(myDatasetWithAcl) :
createAcl(myDatasetWithAcl);
Good to hear, thanks for reporting back! I'll close this ticket then, feel free to open a new one if you encounter further issues.
Search terms you've used
"ACL"
Bug description
setAgentDefaultAccess
,setAgentResourceAccess
,setPublicDefaultAccess
, andsetPublicResourceAccess
do not modify rules if they already exist. The documentation claims thatIf rules already exist for the Agent in the given ACL, in the returned ACL, they are replaced by the new rules.
, but this does not happen in practice.To Reproduce
Create a folder
Define this function for setting ACLs
Run the following
That will cause the ACL to look like
:16200627777229416622674554878 a n0:Authorization; n0:agent c:me; n0:default tes:; n0:mode n0:Control, n0:Read, n0:Write. :16200627777242747520251968627 a n0:Authorization; n0:accessTo tes:; n0:agent c:me; n0:mode n0:Control, n0:Read, n0:Write. :16200627777336972880372581038 a n0:Authorization; n0:agentClass n1:Agent; n0:default tes:; n0:mode n0:Read, n0:Write. :16200627777355729480738631167 a n0:Authorization; n0:accessTo tes:; n0:agentClass n1:Agent; n0:mode n0:Read, n0:Write.
:16200627777229416622674554878 a n0:Authorization; n0:agent c:me; n0:default tes:; n0:mode n0:Control, n0:Read, n0:Write. :16200627777242747520251968627 a n0:Authorization; n0:accessTo tes:; n0:agent c:me; n0:mode n0:Control, n0:Read, n0:Write. :16200627777336972880372581038 a n0:Authorization; n0:agentClass n1:Agent; n0:default tes:; n0:mode n0:Read, n0:Write. :16200627777355729480738631167 a n0:Authorization; n0:accessTo tes:; n0:agentClass n1:Agent; n0:mode n0:Read, n0:Write. :16200630181165886215561149628 a n0:Authorization; n0:agent c:me; n0:default tes:; n0:mode n0:Control, n0:Read, n0:Write. :162006301811724778766789878337 a n0:Authorization; n0:accessTo tes:; n0:agent c:me; n0:mode n0:Control, n0:Read, n0:Write. :16200630181229927508212065623 a n0:Authorization; n0:agent c0:me; n0:default tes:; n0:mode n0:Read, n0:Write. :16200630181237677687525331884 a n0:Authorization; n0:accessTo tes:; n0:agent c0:me; n0:mode n0:Read, n0:Write. :162006301813334106972307351047 a n0:Authorization; n0:agentClass n1:Agent; n0:default tes:; n0:mode n0:Read, n0:Write. :162006301813808167874828088695 a n0:Authorization; n0:accessTo tes:; n0:agentClass n1:Agent; n0:mode n0:Read, n0:Write.
$ npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers System: OS: macOS 11.3 CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz Memory: 119.89 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 15.2.1 - /usr/local/bin/node npm: 7.0.10 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Browsers: Chrome: 90.0.4430.93 Firefox: 88.0 Safari: 14.1 npmPackages: @inrupt/solid-auth-fetcher: jaxoncreed/solid-auth-fetcher-fork#master => 0.0.6 @inrupt/solid-client: ^1.0.0 => 1.6.1 @inrupt/solid-client-authn-browser: ^1.0.0 => 1.8.0 @rdfjs/fetch: ^2.1.0 => 2.1.0 @types/bluebird: ^3.5.33 => 3.5.33 @types/clownface: ^1.0.1 => 1.2.0 @types/cookie-parser: ^1.4.2 => 1.4.2 @types/cors: ^2.8.7 => 2.8.10 @types/express: ^4.17.8 => 4.17.11 @types/express-session: ^1.17.0 => 1.17.3 @types/ioredis: ^4.17.8 => 4.26.0 @types/jest: ^26.0.14 => 26.0.22 @types/jsonschema: ^1.1.1 => 1.1.1 @types/mongodb: ^3.6.0 => 3.6.12 @types/multer: ^1.4.5 => 1.4.5 @types/node-cron: ^2.0.3 => 2.0.3 @types/node-fetch: ^2.5.7 => 2.5.10 @types/parse-link-header: ^1.0.0 => 1.0.0 @types/rdfjsdataset: ^1.0.4 => 1.0.4 @types/rdfjsfetch: ^2.0.2 => 2.0.2 @types/rdfjs__parser-n3: ^1.1.3 => 1.1.3 @types/socket.io: ^2.1.11 => 2.1.13 @types/url-parse: ^1.4.3 => 1.4.3 @types/uuid: ^8.3.0 => 8.3.0 @types/web-push: ^3.3.0 => 3.3.0 @types/ws: ^7.4.0 => 7.4.1 @typescript-eslint/eslint-plugin: ^4.2.0 => 4.22.0 @typescript-eslint/parser: ^4.2.0 => 4.22.0 bluebird: ^3.7.2 => 3.7.2 body-parser: ^1.19.0 => 1.19.0 clownface: ^1.0.0 => 1.2.0 cookie: ^0.4.0 => 0.4.1 cookie-parser: ^1.4.5 => 1.4.5 cors: ^2.8.5 => 2.8.5 dotenv: ^8.2.0 => 8.2.0 eslint: ^7.10.0 => 7.25.0 eslint-config-prettier: ^6.12.0 => 6.15.0 eslint-plugin-prettier: ^3.1.4 => 3.4.0 expo-server-sdk: ^3.6.0 => 3.6.0 express: 5.0.0-alpha.8 => 5.0.0-alpha.8 express-session: ^1.17.1 => 1.17.1 ioredis: ^4.19.2 => 4.26.0 jest: ^26.4.2 => 26.6.3 jsonschema: ^1.4.0 => 1.4.0 jsonwebtoken: ^8.5.1 => 8.5.1 mongodb: ^3.6.3 => 3.6.6 multer: ^1.4.2 => 1.4.2 n3: ^1.6.4 => 1.9.0 node-cron: ^2.0.3 => 2.0.3 node-fetch: ^2.6.1 => 2.6.1 onesignal-node: ^3.2.0 => 3.2.1 prettier: ^2.1.2 => 2.2.1 socket.io: ^3.0.3 => 3.1.2 socket.io-client: ^3.0.3 => 3.1.3 ts-node: ^9.0.0 => 9.1.1 ts-node-dev: ^1.0.0-pre.63 => 1.1.6 typescript: ^4.1.2 => 4.2.4 url-parse: ^1.4.7 => 1.5.1 uuid: ^8.3.2 => 8.3.2 web-push: ^3.4.4 => 3.4.4 ws: ^7.4.0 => 7.4.5 npmGlobalPackages: @paciolan/remote-component: 0.0.0-semantic-versioning @paciolan/remote-module-loader: 1.0.0-symantec-versioning @solid/oidc-auth-manager: 0.24.1 @solid/oidc-op: 0.11.1 componentsjs-generator: 1.6.0 dts-gen: 0.6.0 expo-cli: 4.0.16 http-server: 0.12.3 jest: 26.6.3 nodemon: 2.0.6 npm-check-updates: 10.2.2 npm: 6.14.9 ochat-api: 1.0.0 oidc-provider: 6.29.8 react-dom: 16.13.1 react: 16.13.1 ts-node-dev: 1.0.0 ts-node: 9.0.0 typescript: 4.1.2