code: def changePermissionsRecursively(path, uid, gid):
      
      os.chown(path, uid, gid)
      for item in os.listdir(path):
          itempath = os.path.join(path, item)
          if os.path.isfile(itempath):
              # Setting owner
              try:
                  os.chown(itempath, uid, gid)
              except Exception as e:
                  # If this crashes it may be because we are running the
                  # application in Windows systems, where os.chown does NOT work.
                  pass
              # Setting permissions
              os.chmod(itempath, 600)
          elif os.path.isdir(itempath):
              # Setting owner
              try:
                  os.chown(itempath, uid, gid)
              except Exception as e:
                  # If this crashes it may be because we are running the
                  # application in Windows systems, where os.chown does NOT work.
                  pass
              # Setting permissions
              os.chmod(itempath, 6600)
              # Recursive function to iterate the files
              changePermissionsRecursively(itempath, uid, gid)
docs: Function to recursively change the user id and group id.
  
      It sets 700 permissions.