def METHOD_NAME(csv):
  if 'permissions' in csv['spec']['install']['spec']:
    for perm in csv['spec']['install']['spec']['permissions']:
        name = perm['serviceAccountName']
        role = {
          "apiVersion": "rbac.authorization.k8s.io/v1",
          "kind" : "Role",
          "metadata" : {
            "name" : name,
            "namespace": namespace
          },
          "rules" : perm['rules']
        }
        writeResource(role)
        binding = {
          "apiVersion": "rbac.authorization.k8s.io/v1",
          "kind" : "RoleBinding",
          "metadata" : {
            "name" : name,
            "namespace": namespace
          },
          "roleRef" : {
             "apiGroup" : "rbac.authorization.k8s.io",
             "kind" : "Role",
             "name" : name
          },
          "subjects" : [
            {
              "kind":"ServiceAccount",
              "name": name
            }
          ]
        }
        writeResource(binding)