in with the new
This commit is contained in:
13
src/core/plugins/auth/spec-wrap-actions.js
Normal file
13
src/core/plugins/auth/spec-wrap-actions.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Map } from "immutable"
|
||||
|
||||
// Add security to the final `execute` call ( via `extras` )
|
||||
export const execute = ( oriAction, { authSelectors, specSelectors }) => ({ path, method, operation, extras }) => {
|
||||
let securities = {
|
||||
authorized: authSelectors.authorized() && authSelectors.authorized().toJS(),
|
||||
definitions: specSelectors.securityDefinitions() && specSelectors.securityDefinitions().toJS(),
|
||||
specSecurity: specSelectors.security() && specSelectors.security().toJS()
|
||||
}
|
||||
|
||||
return oriAction({ path, method, operation, securities, ...extras })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user