Merge pull request #250 from CartoDB/accept-open-string-as-valid-auth
Accept open string as valid auth
This commit is contained in:
commit
9523d40937
3
NEWS.md
3
NEWS.md
@ -1,6 +1,9 @@
|
||||
1.26.2 -- 2015-mm-dd
|
||||
--------------------
|
||||
|
||||
Bugfixes:
|
||||
- Accept 'open' string in templates' `auth` as authorized.
|
||||
|
||||
|
||||
1.26.1 -- 2015-01-28
|
||||
--------------------
|
||||
|
@ -398,6 +398,10 @@ o.isAuthorized = function(template, authTokens) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_.isString(templateAuth) && templateAuth === 'open') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (templateAuth.method === 'open') {
|
||||
return true;
|
||||
}
|
||||
|
@ -92,4 +92,14 @@ suite('template_maps_auth', function() {
|
||||
})
|
||||
});
|
||||
|
||||
test("auth as 'open' string is authorized", function(done) {
|
||||
var template = {
|
||||
name: 'wadus_template',
|
||||
auth: 'open'
|
||||
};
|
||||
|
||||
assert.ok(templateMaps.isAuthorized(template));
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user