openvibers/openvibe.network Commits

Network: Chat may read a Food household for its AI member (food.household.read) (#219)

OP OpenVibers committed 29 days ago · 534532a964 · 1 file, +2 −0

Contracts 0.189.0 added food.household.read (owner food, internal). Chat's AI members linked to a Food household (Chat#102) read its pantry and plan from Food's /internal/households/:id/chat-context with Chat's service token; this grants the capability to chat for openvibe.food.

Changes

ddiff --git a/server/identity/principals.js b/server/identity/principals.js
iindex df35bedd..45f3b6b8 100644
---- a/server/identity/principals.js
++++ b/server/identity/principals.js
@@@ -104,6 +104,8 @@ const DEFAULT_GRANTS = [
['chat', 'media.object.delete', 'openvibe.media', ['chat']],
['chat', 'ai.run.create', 'openvibe.ai', ['chat.*']],
['chat', 'ai.run.read', 'openvibe.ai', ['chat.*']],
++ // Chat's AI members linked to a Food household read its pantry and plan (food.household.read; Contracts 0.189.0).
++ ['chat', 'food.household.read', 'openvibe.food', []],
['games', 'identity.subject.resolve', SELF_AUDIENCE, []],
// Games subscribes to network.user.token_valid_after (sign-out everywhere closes game sessions).
['games', 'events.subscription.manage', 'openvibe.events', []],