summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/call.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server/api/call.ts b/src/server/api/call.ts
index e9abc11f54..ee79e0a13c 100644
--- a/src/server/api/call.ts
+++ b/src/server/api/call.ts
@@ -25,10 +25,8 @@ export default (endpoint: string, user: IUser, app: IApp, data: any, file?: any)
return rej('YOU_ARE_NOT_ADMIN');
}
- if (app && ep.meta.kind) {
- if (!app.permission.some(p => p === ep.meta.kind)) {
- return rej('PERMISSION_DENIED');
- }
+ if (app && ep.meta.kind && !app.permission.some(p => p === ep.meta.kind)) {
+ return rej('PERMISSION_DENIED');
}
if (ep.meta.requireCredential && ep.meta.limit) {