1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-28 23:09:16 +09:00

if elimination (#2635)

This commit is contained in:
Aya Morisawa 2018-09-06 06:06:22 +09:00 committed by syuilo
parent 2448bf4e4e
commit 8e359d54bd

View File

@ -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) {