Policy

@policy({
  name: 'effective policy',
  action: 'Script',
  weight: 1
})
myPolicy({ runtime }) {

  return true

}

@policy(options)

Arguments

  • options { Object } Options object

    • name { String }

    • environment { String = "*" }

    • weight { Number = 0 }

    • action { String } Policy action (Script, Transform)

Method Options

  • methodOptions { Object } Options passed to the method

    • req { Object }

    • body { Object }

    • halt {Function} When called, haults the policy and exits the script

    • runtime { Object }

      • name { String }

      • environment { String = "*" }

      • weight { Number = 0 }

      • metadata { Object }

        • resource { String }

        • className { String }

        • methodName { String }

        • static { Boolean }

        • loc { Object }

          • line { String }

          • column { String }

Method Options (Transform Action)

  • methodOptions { Object } Options passed to the method

    • runtime { Object }

      • name { String }

      • environment { String = "*" }

      • weight { Number = 0 }

      • metadata { Object }

        • resource { String }

        • className { String }

        • methodName { String }

        • static { Boolean }

        • loc { Object }

          • line { String }

          • column { String }

Examples

Last updated

Was this helpful?