Skip to content

Commit

Permalink
fix(database): missing fields reduce in permission check
Browse files Browse the repository at this point in the history
chore: update yarn.lock
  • Loading branch information
kkopanidis committed Aug 30, 2023
1 parent 98bf501 commit 1efc868
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/database/src/permissions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export async function canModify(moduleName: string, schema: Schema, data?: Index
extension.ownerModule === moduleName || extension.ownerModule === 'database',
)
.map((extension: DeclaredSchemaExtension) => extension.fields)
.map((fields: ConduitModel) => Object.keys(fields));
.map((fields: ConduitModel) => Object.keys(fields))
.reduce((acc: string[], curr: string[]) => [...acc, ...curr], []);
const dataFields = Object.keys(data);
return dataFields.every((field: string) => extensionFields.includes(field));
}
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14508,6 +14508,11 @@ url-parse@^1.4.3, url-parse@^1.5.9:
querystringify "^2.1.1"
requires-port "^1.0.0"

url-polyfill@^1.1.12:
version "1.1.12"
resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.12.tgz#6cdaa17f6b022841b3aec0bf8dbd87ac0cd33331"
integrity sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A==

url@0.10.3:
version "0.10.3"
resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64"
Expand Down Expand Up @@ -14804,6 +14809,19 @@ winston-loki@^6.0.6:
optionalDependencies:
snappy "7.1.1"

winston-loki@^6.0.7:
version "6.0.7"
resolved "https://registry.yarnpkg.com/winston-loki/-/winston-loki-6.0.7.tgz#c16e8385f90f3bccb28d98479158a77103974436"
integrity sha512-6psEy428ckTXP/ni+DrA4vas2Ldt/43TFm7beoVExKLlTyEwu7zu2c8GBGbnxrdzRQAxXUfom2sK7zr4QP8y5g==
dependencies:
async-exit-hook "2.0.1"
btoa "^1.2.1"
protobufjs "^7.2.4"
url-polyfill "^1.1.12"
winston-transport "^4.3.0"
optionalDependencies:
snappy "7.1.1"

winston-transport@^4.3.0, winston-transport@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa"
Expand Down

0 comments on commit 1efc868

Please sign in to comment.