remove spaces support

this feature is unused for too long now
This commit is contained in:
Girish Ramakrishnan
2019-05-04 18:34:02 -07:00
parent b4b3fd9ab6
commit e553ade936
6 changed files with 4 additions and 45 deletions

View File

@@ -1,8 +1,6 @@
'use strict';
exports = module.exports = {
verifyOwnership: verifyOwnership,
getApp: getApp,
getApps: getApps,
getAppIcon: getAppIcon,
@@ -43,25 +41,6 @@ var apps = require('../apps.js'),
util = require('util'),
WebSocket = require('ws');
function verifyOwnership(req, res, next) {
if (req.user.admin) return next();
if (!config.isSpacesEnabled()) return next();
const appCreate = !('id' in req.params);
if (appCreate) return next(); // ok to install app
apps.get(req.params.id, function (error, app) {
if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app'));
if (error) return next(new HttpError(500, error));
if (app.ownerId !== req.user.id) return next(new HttpError(403, 'User is not owner'));
next();
});
}
function getApp(req, res, next) {
assert.strictEqual(typeof req.params.id, 'string');