parent
dc9a19b9c7
commit
56d571c0f0
23 changed files with 191 additions and 17 deletions
|
|
@ -29,6 +29,10 @@ export default (endpoint: string, user: IUser, app: IApp, data: any, file?: any)
|
|||
return rej('YOU_ARE_NOT_ADMIN');
|
||||
}
|
||||
|
||||
if (ep.meta.requireModerator && !user.isAdmin && !user.isModerator) {
|
||||
return rej('YOU_ARE_NOT_MODERATOR');
|
||||
}
|
||||
|
||||
if (app && ep.meta.kind && !app.permission.some(p => p === ep.meta.kind)) {
|
||||
return rej('PERMISSION_DENIED');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue