Skip to content

Commit

Permalink
Merge pull request #4427 from alkem-io/vc-patch
Browse files Browse the repository at this point in the history
AI persona authorization properly assigned
  • Loading branch information
hero101 authored Aug 20, 2024
2 parents fe6e4b2 + 32aef15 commit b5cbf8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-server",
"version": "0.88.0",
"version": "0.88.1",
"description": "Alkemio server, responsible for managing the shared Alkemio platform",
"author": "Alkemio Foundation",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AiPersonaAuthorizationService {
applyAuthorizationPolicy(
aiPersona: IAiPersona,
parentAuthorization: IAuthorizationPolicy | undefined
): IAiPersona {
): IAuthorizationPolicy {
if (!aiPersona.authorization) {
throw new RelationshipNotFoundException(
`Unable to load entities for virtual persona: ${aiPersona.id} `,
Expand All @@ -40,7 +40,7 @@ export class AiPersonaAuthorizationService {
aiPersona.id
);

return aiPersona;
return aiPersona.authorization;
}

private appendCredentialRules(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class VirtualContributorAuthorizationService {
);
const updatedAuthorizations: IAuthorizationPolicy[] = [];

virtual.authorization = await this.authorizationPolicyService.reset(
virtual.authorization = this.authorizationPolicyService.reset(
virtual.authorization
);
virtual.authorization =
Expand Down Expand Up @@ -85,11 +85,12 @@ export class VirtualContributorAuthorizationService {
);
updatedAuthorizations.push(agentAuthorization);

virtual.aiPersona =
const aiPersonaAuthorization =
this.aiPersonaAuthorizationService.applyAuthorizationPolicy(
virtual.aiPersona,
virtual.authorization
);
updatedAuthorizations.push(aiPersonaAuthorization);

return updatedAuthorizations;
}
Expand Down

0 comments on commit b5cbf8d

Please sign in to comment.