1. A system for automatically generating code for an authorization policy for network resources, the system comprising: one or more processors; and a memory in communication with the one or more processors, wherein the memory contains instructions that when executed by the one or more processors, cause the one or more processors to: automatically generate obligation code for the policy, in a first programming language, wherein rules of the policy are modeled using an ontologically defined ruleset, wherein the obligation code includes a plurality of function calls; and after generating the obligation code, automatically generate XACML rule code for the policy based on the same ontologically defined ruleset, wherein the first programming language is not XACML, wherein the one or more processors are programmed to generate the XACML rule code for the policy by inserting calling details for each of the plurality of function calls of the obligation code in the XACML code.