Skip to content

Commit 7e22cce

Browse files
Fixed credentials bug with alternative Excel exports
1 parent 55b4f94 commit 7e22cce

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Resources/templates/CommonAdmin/ExcelAction/ExcelBuilderAction.php.twig

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,20 @@ class ExcelController extends \{{ namespace_prefix }}\{{ bundle_name }}\Controll
3131
{
3232
$this->request = $request;
3333
34-
{{ block('security_action') }}
34+
if ($key === null) {
35+
// Standard credential check
36+
{{ block('security_action') }}
37+
} else {
38+
{% for eaction in builder.excelActions %}
39+
{% if eaction.credentials is not empty and eaction.credentials is not same as('AdmingenAllowed') %}
40+
// Check specific credentials
41+
$this->denyAccessUnlessValidateCredentials('{{ eaction.credentials }}');
42+
{% else %}
43+
// Check default if not specific credentials are given
44+
{{ block('security_action') }}
45+
{% endif %}
46+
{% endfor %}
47+
}
3548
3649
// Create the PHPExcel object with some standard values
3750
try {

0 commit comments

Comments
 (0)