1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00

S2S: Project: Send ext-Grants to new collab upon getting their delegator-Grant

Until now, adding a direct collaborator to a Project worked exactly like
with components: Invite or Join, then Accept, finally the direct-Grant.
I missed the fact that much like with project-component relationships,
projects (and teams) need to be able to send extension-Grants to their
direct collaborators.

So in Project's Grant handler it now:

- Recognizes the delegator-Grant coming from a new collaborator
- Sends extension-Grants, using the delegator-Grant as the capability
- When getting a new component and sending extension-Grants for it to
  direct collaborators, Project uses their delegator-Grants as
  capability

And in Project's Accept handler, it no longer sends extension-Grants
(because it doesn't yet have the collaborator's delegator-Grant at this
point).

NOTE, THIS TEMPORARILY BREAKS grant chains: If you create a Project and
add a Deck to it, you won't get an extension-Grant-for-the-Deck from the
Project, because the Project doesn't yet have your delegator-Grant.

The next commits will implement the Person-side of Collab records, and
will cause Person actors to automatically send the delegator-Grant,
fixing the break.
This commit is contained in:
Pere Lev 2023-11-22 14:16:08 +02:00
parent 5d0f707c55
commit 88e6818edc
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D
20 changed files with 751 additions and 642 deletions

View file

@ -903,7 +903,7 @@ ComponentDelegateRemote
-- direct collaborator
ComponentFurtherLocal
component ComponentEnableId
collab CollabRecipLocalId
collab CollabDelegLocalId
grant OutboxItemId
UniqueComponentFurtherLocal component collab
@ -913,7 +913,7 @@ ComponentFurtherLocal
-- direct collaborator
ComponentFurtherRemote
component ComponentEnableId
collab CollabRecipRemoteId
collab CollabDelegRemoteId
grant OutboxItemId
UniqueComponentFurtherRemote component collab