code: def make_get_perms_object(perms_objs):
      
      def retfn(obj, action):
          if action in perms_objs:
              if perms_objs[action] is None:
                  return None
              else:
                  return get_perms_object(getattr(obj, perms_objs[action]),
                                          action)
          else:
              return get_perms_object(obj, action)
      return retfn
docs: Make a function to delegate permission object rendering to some
      other (foreign key) field of an object.