Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass multiple users to webacl.resource.addRights #908

Closed
srosset81 opened this issue Dec 17, 2021 · 1 comment
Closed

Pass multiple users to webacl.resource.addRights #908

srosset81 opened this issue Dec 17, 2021 · 1 comment

Comments

@srosset81
Copy link
Contributor

srosset81 commented Dec 17, 2021

Currently, to give several users rights to the same resource, we have to call the webacl.resource.addRights action once per user.

This is costly in terms of performance, as the addRights action performs a lot of checks (locally, it takes almost 1 second per user).

My suggestion would be to allow multiple users to be passed in this way:

await ctx.call('webacl.resource.addRights', {
  resourceUri,
  additionalRights: {
    user: {
      uri: [user1, user2],
      read: true
    }
  },
  webId: 'system'
});

If I'm not mistaken, all we need to do is change these lines:
https://github.com/assemblee-virtuelle/semapps/blob/master/src/middleware/packages/webacl/utils.js#L257-L262

@srosset81 srosset81 added the acl label Dec 17, 2021
@srosset81 srosset81 changed the title Pouvoir passer plusieurs utilisateurs à webacl.resource.addRights Pass multiple users to webacl.resource.addRights May 8, 2024
@Laurin-W
Copy link
Contributor

Laurin-W commented Nov 8, 2024

I suppose this has changed to those lines:

https://github.com/assemblee-virtuelle/semapps/blob/19eb214e9d5cd6593e5a2e7fe7e2fbb7b863bbd4/src/middleware/packages/webacl/utils.js#L277C2-L282C4

Will create a PR :)

Laurin-W added a commit that referenced this issue Nov 12, 2024
Laurin-W added a commit that referenced this issue Nov 13, 2024
…ance #908 (#1332)

* chore: improve description in objects-watcher

* chore: address #908

* fix: deduplicate return values of `getUsersWithReadRights`

* chore: refactor activitypub `setRightsHandler`

* fix: add :z tags to docker volumes for SELinux

* add `cc` to AP object processor

* object watcher: send Update using `bto` instead of `to`

* make fake queue mixin export itself

* support passing multiple users for `webacl.resource.addRights` etc. actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants