HOTFIX: fixed scopes for designers (#145)

This commit is contained in:
Arwid Thornström
2023-02-23 14:34:02 +01:00
committed by GitHub
parent 1193e2940d
commit 0a26a3143e
+4 -5
View File
@@ -21,10 +21,6 @@ export class DesignerAPI extends BaseSQLDataSource {
}
async getDesignerById(id: number): Promise<Designer> {
ScopeAccess.validate(this.user).some([
Scopes.DESIGNERS_READ,
Scopes.DESIGNERS_PUBLIC_READ,
]);
return this.loader.load(id);
}
@@ -49,7 +45,10 @@ export class DesignerAPI extends BaseSQLDataSource {
limit: number = 5000,
ids?: number[],
): Promise<Array<Designer>> {
ScopeAccess.validate(this.user).all([Scopes.DESIGNERS_READ]);
ScopeAccess.validate(this.user).some([
Scopes.DESIGNERS_READ,
Scopes.DESIGNERS_PUBLIC_READ,
]);
return (
this.knex
.select(