Skip to content

Commit 95665f1

Browse files
Merge pull request #1 from haiodo/fix-formatting
Enable formatting check
2 parents b124372 + e61afca commit 95665f1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ jobs:
2525
run: node common/scripts/install-run-rush.js install
2626
- name: Rush validate
2727
run: node common/scripts/install-run-rush.js validate --verbose
28+
- name: Formatting...
29+
run: node common/scripts/install-run-rush.js format --force
30+
- name: Check files formatting
31+
run: |
32+
echo '================================================================'
33+
echo 'Checking for diff files'
34+
echo '================================================================'
35+
git diff '*.js' '*.ts' '*.svelte' '*.json' '*.yaml' | cat
36+
[ -z "$(git diff --name-only '*.js' '*.ts' '*.svelte' '*.json' '*.yaml' | cat)" ]
37+
echo '================================================================'
2838
- name: Prepare server
2939
run: |
3040
cd ./tests
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@hcengineering/middleware",
5+
"comment": "Fix formatting",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@hcengineering/middleware"
10+
}

packages/middleware/src/spacePermissions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,15 @@ export class SpacePermissionsMiddleware extends BaseMiddleware implements Middle
160160
private checkPermission (ctx: MeasureContext<SessionData>, space: Ref<TypedSpace>, tx: TxCUD<Doc>): boolean {
161161
const account = ctx.contextData.account
162162
const permissions = this.permissionsBySpace[space]?.[account.uuid] ?? []
163-
let withoutMatch: Permission | undefined = undefined
163+
let withoutMatch: Permission | undefined
164164
for (const permission of permissions) {
165165
if (permission.txClass === undefined || permission.txClass !== tx._class) continue
166-
if (permission.objectClass !== undefined && !this.context.hierarchy.isDerived(tx.objectClass, permission.objectClass)) continue
166+
if (
167+
permission.objectClass !== undefined &&
168+
!this.context.hierarchy.isDerived(tx.objectClass, permission.objectClass)
169+
) {
170+
continue
171+
}
167172
if (permission.txMatch === undefined) {
168173
withoutMatch = permission
169174
continue

0 commit comments

Comments
 (0)