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:
14
src/apps.js
14
src/apps.js
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user