Rewire AuthorizeOperationBtn; create new selector for filtering definitions

This commit is contained in:
Kyle Shockey
2017-11-06 20:42:47 -08:00
parent cca8ddb5d5
commit 21bf5919a9
3 changed files with 25 additions and 21 deletions

View File

@@ -58,6 +58,13 @@ export const getDefinitionsByNames = ( state, securities ) => ( { specSelectors
return result
}
export const definitionsForRequirements = (state, securities) => ({ authSelectors }) => {
const allDefinitions = authSelectors.definitionsToAuthorize()
return allDefinitions.filter((def, name) => {
return securities.has(name)
})
}
export const authorized = createSelector(
state,
auth => auth.get("authorized") || Map()