From 741731c1b915a2614889fef71a1f4c8d59d6f97c Mon Sep 17 00:00:00 2001 From: Ferruh Cihan <63190600+ferruhcihan@users.noreply.github.com> Date: Thu, 13 Mar 2025 16:59:18 +0100 Subject: [PATCH 1/2] fix: create policies with the new team creation --- src/otomi-stack.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/otomi-stack.ts b/src/otomi-stack.ts index 9660eca1d..6880c59a8 100644 --- a/src/otomi-stack.ts +++ b/src/otomi-stack.ts @@ -623,11 +623,12 @@ export default class OtomiStack { if (!data.id) { const policies = getPolicies() this.db.db.set(`policies[${data.name}]`, policies).write() + await this.saveTeamPolicies(data.name) } if (deploy) { const secretPaths = this.getSecretPaths() await this.saveTeams(secretPaths) - await this.doDeployment(['teams']) + await this.doDeployment(['teams', 'policies']) } return team } From 096cef878287c8888cd8d9fb71fa879f6ffd0ecc Mon Sep 17 00:00:00 2001 From: Ferruh Cihan <63190600+ferruhcihan@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:14:45 +0100 Subject: [PATCH 2/2] fix: create policies for teams --- src/otomi-stack.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/otomi-stack.ts b/src/otomi-stack.ts index 6880c59a8..b59ec2273 100644 --- a/src/otomi-stack.ts +++ b/src/otomi-stack.ts @@ -620,12 +620,12 @@ export default class OtomiStack { if (id !== 'admin' && (isShared || inTeamApps)) this.db.createItem('apps', {}, { teamId: id, id: appId }, appId) }) - if (!data.id) { - const policies = getPolicies() - this.db.db.set(`policies[${data.name}]`, policies).write() - await this.saveTeamPolicies(data.name) - } if (deploy) { + if (!data.id) { + const policies = getPolicies() + this.db.db.set(`policies[${data.name}]`, policies).write() + await this.saveTeamPolicies(data.name) + } const secretPaths = this.getSecretPaths() await this.saveTeams(secretPaths) await this.doDeployment(['teams', 'policies'])