apps: hasAccessTo -> canAccess

This commit is contained in:
Girish Ramakrishnan
2021-09-21 10:00:47 -07:00
parent 737412653f
commit f44fa2cf47
4 changed files with 18 additions and 18 deletions

View File

@@ -167,7 +167,7 @@ async function authorize(req, res, next) {
const [error, app] = await safe(apps.get(appId));
if (error) return next(new HttpError(403, 'No such app' ));
if (!apps.hasAccessTo(app, req.user)) return next(new HttpError(403, 'Forbidden' ));
if (!apps.canAccess(app, req.user)) return next(new HttpError(403, 'Forbidden' ));
const token = jwt.sign({ user: users.removePrivateFields(req.user) }, TOKEN_SECRET, { expiresIn: `${constants.DEFAULT_TOKEN_EXPIRATION_DAYS}d` });