Improving Gitlab compatibility

This commit is contained in:
Fabian Stamm 2019-03-14 18:20:54 +00:00
parent e800dd266a
commit 4f54d048c6

View File

@ -46,7 +46,7 @@ const AuthRoute = Stacker(GetUserMiddleware(true), async (req: Request, res: Res
let permissions: IPermission[] = []; let permissions: IPermission[] = [];
if (scope) { if (scope) {
let perms = (<string>scope).split(";").map(p => new ObjectID(p)); let perms = (<string>scope).split(";").filter(e => e !== "read_user").map(p => new ObjectID(p));
permissions = await Permission.find({ _id: { $in: perms } }) permissions = await Permission.find({ _id: { $in: perms } })
if (permissions.length != perms.length) { if (permissions.length != perms.length) {