Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

authorizedScope can be/is an array of arrays here #259

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion models/Scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ Scope.determine = function (scopes, subject, callback) {

// filter authorized scope
scopes = knownScope.filter(function (scope) {
return !scope.restricted || authorizedScope.indexOf(scope.name) !== -1
var found;
if (typeof authorizedScope === 'object') {
authorizedScope.map(function(result) {
found = found || (result.indexOf(scope.name) !== -1);
});
}

return !scope.restricted || found || authorizedScope.indexOf(scope.name) !== -1
})

// extract scope names
Expand Down