code: public function setPermissions(PermissionsInterface $permissions)
      {
          foreach ($this->getImages() as $file) {
              /* @var PermissionsInterface $filePermissions */
              /* @var \Core\Entity\FileInterface $file */
              $filePermissions = $file->getPermissions();
              $filePermissions->clear();
              $filePermissions->inherit($permissions);
          }
  
          return $this;
      }
docs: Set permissions for all images in this set.
  
  @param PermissionsInterface $permissions
  
  @return self