move requiresOAuthProxy to nginx

we have 3 levels
    * routes, cron, apptask
    * everything else where everyone calls everyone :-)
    * the db layer
This commit is contained in:
Girish Ramakrishnan
2016-03-17 11:38:27 -07:00
parent 42796b12dc
commit 3499a4cc6c
3 changed files with 18 additions and 19 deletions

View File

@@ -6,7 +6,6 @@ exports = module.exports = {
AppsError: AppsError,
hasAccessTo: hasAccessTo,
requiresOAuthProxy: requiresOAuthProxy,
get: get,
getBySubdomain: getBySubdomain,
@@ -281,19 +280,6 @@ function hasAccessTo(app, user, callback) {
});
}
function requiresOAuthProxy(app) {
assert.strictEqual(typeof app, 'object');
var tmp = app.accessRestriction;
// if no accessRestriction set, or the app uses one of the auth modules, we do not need the oauth proxy
if (tmp === null) return false;
if (app.manifest.addons['ldap'] || app.manifest.addons['oauth'] || app.manifest.addons['simpleauth']) return false;
// check if any restrictions are set
return !!((tmp.users && tmp.users.length) || (tmp.groups && tmp.groups.length));
}
function get(appId, callback) {
assert.strictEqual(typeof appId, 'string');
assert.strictEqual(typeof callback, 'function');