Commit 686343dd authored by Primsi's avatar Primsi
Browse files

Issue #2555437 by Primsi: Users without dropzone upload permissions shouldn't...

Issue #2555437 by Primsi: Users without dropzone upload permissions shouldn't be able to use the widget
parent a985b095
......@@ -76,6 +76,11 @@ class DropzoneJs extends FormElement {
'#attributes' => ['data-upload-path' => \Drupal::url('dropzonejs.upload')],
];
if (!\Drupal::currentUser()->hasPermission('dropzone upload files')) {
$element['#access'] = FALSE;
drupal_set_message("You don't have sufficent permissions to use the DropzoneJS uploader. Contact your system administrator", 'warning');
}
return $element;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment