Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User can still see upload file popup even if setUploadEnabled is false #1380

Open
mark-a-j-adriano opened this issue Aug 8, 2023 · 0 comments

Comments

@mark-a-j-adriano
Copy link

Description:

  • User are still able to upload files from their local even if we only want them to use the File management / Asset admin option
  • They did receive Uploading not permitted. error message after trying.

Expected:

  • The pop up to browse from local file should not show up when clicking anywhere inside the upload field.
Screen.Recording.2023-08-09.at.11.12.34.AM.mp4

Packages:

  • "name": "silverstripe/asset-admin", "version": "2.0.1",
  • "name": "silverstripe/assets", "version": "2.0.3",
  • "name": "silverstripe/cms", "version": "5.0.2",
  • "name": "silverstripe/framework", "version": "5.0.8",

Sample code:

private static array $has_one = [
      'Image' => Image::class, 
 ];

 public function getCMSFields(): FieldList
 {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Main', $img1 = UploadField::create('Image', 'Image'));
        $img1->setFolderName('Sections')
            ->setIsMultiUpload(false)
            ->setAllowedMaxFileNumber(1)
            ->setUploadEnabled(false)
            ->setAllowedFileCategories('image');
}
@mark-a-j-adriano mark-a-j-adriano changed the title User can still see upload file even if setUploadEnabled is false User can still see upload file popup even if setUploadEnabled is false Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants