mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-06 20:43:13 +08:00
Added auth middleware. Added access control to apps
This commit is contained in:
@@ -25,13 +25,18 @@ const getAllApps = asyncWrapper(async (req, res, next) => {
|
||||
await useKubernetes(apps);
|
||||
}
|
||||
|
||||
// apps visibility
|
||||
const where = req.isAuthenticated ? {} : { isPublic: true };
|
||||
|
||||
if (orderType == 'name') {
|
||||
apps = await App.findAll({
|
||||
order: [[Sequelize.fn('lower', Sequelize.col('name')), 'ASC']],
|
||||
where,
|
||||
});
|
||||
} else {
|
||||
apps = await App.findAll({
|
||||
order: [[orderType, 'ASC']],
|
||||
where,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user