Skip to content
Snippets Groups Projects
Commit 8e359d54 authored by Aya Morisawa's avatar Aya Morisawa Committed by syuilo
Browse files

if elimination (#2635)

parent 2448bf4e
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment