{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      },
      {
        "type": "text",
        "name": "userid"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "userroles",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "authdb",
          "sql": {
            "type": "select",
            "columns": [
              {
                "table": "xuserrole",
                "column": "userid",
                "recid": 1
              },
              {
                "table": "roles",
                "column": "id",
                "recid": 2
              },
              {
                "table": "roles",
                "column": "name",
                "recid": 3
              },
              {
                "table": "roles",
                "column": "isDepartment",
                "recid": 4
              }
            ],
            "params": [],
            "table": {
              "name": "roles"
            },
            "primary": "id",
            "joins": [
              {
                "table": "xuserrole",
                "column": "*",
                "type": "INNER",
                "clauses": {
                  "condition": "AND",
                  "rules": [
                    {
                      "table": "xuserrole",
                      "column": "roleid",
                      "operator": "equal",
                      "operation": "=",
                      "value": {
                        "table": "roles",
                        "column": "id"
                      }
                    }
                  ]
                },
                "primary": "id"
              }
            ],
            "query": "select `xuserrole`.`userid`, `roles`.`id`, `roles`.`name`, `roles`.`isDepartment` from `roles` inner join `xuserrole` on `xuserrole`.`roleid` = `roles`.`id`"
          }
        },
        "meta": [
          {
            "type": "number",
            "name": "userid"
          },
          {
            "type": "number",
            "name": "id"
          },
          {
            "type": "text",
            "name": "name"
          },
          {
            "type": "boolean",
            "name": "isDepartment"
          }
        ],
        "outputType": "array",
        "output": true
      },
      {
        "name": "dbvals",
        "module": "core",
        "action": "setvalue",
        "options": {
          "key": "g_dbvals",
          "value": "{{userroles}}"
        },
        "meta": [
          {
            "name": "userid",
            "type": "number"
          },
          {
            "name": "id",
            "type": "number"
          },
          {
            "name": "name",
            "type": "text"
          },
          {
            "name": "isDepartment",
            "type": "boolean"
          }
        ],
        "outputType": "array",
        "metaData": {
          "setValueExpression": {
            "name": "userroles",
            "type": "array"
          }
        },
        "output": true
      }
    ]
  }
}