Skip to content

Commit b3be02b

Browse files
committed
add import for IsGranted attribute
1 parent 9093bad commit b3be02b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/symfony/controller/ControllerLayer.xtend

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ class ControllerLayer {
170170

171171
return $this->entityInitializer->init«name.formatForCodeCapital»($entity);
172172
}
173-
174173
«FOR action : actions»
175-
«legacyActionHelper.generate(it, action, true
176174

175+
«legacyActionHelper.generate(it, action, true
177176
«ENDFOR»
178177
«FOR action : customActions»
179178
«IF action.requiredFor(it
179+
180180
«action.controllerUsage(application, it
181181
«ENDIF»
182182
«ENDFOR»

bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/symfony/controller/action/ApplyBulkOperation.xtend

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ApplyBulkOperation extends AbstractAction {
3030
'Symfony\\Component\\HttpFoundation\\Request',
3131
'Symfony\\Component\\Security\\Core\\User\\UserInterface',
3232
'Symfony\\Component\\Security\\Http\\Attribute\\CurrentUser',
33+
'Symfony\\Component\\Security\\Http\\Attribute\\IsGranted',
3334
'function Symfony\\Component\\Translation\\t',
3435
'Symfony\\Contracts\\Translation\\TranslatorInterface',
3536
appNamespace + '\\Helper\\WorkflowHelper'
@@ -81,6 +82,10 @@ class ApplyBulkOperation extends AbstractAction {
8182

8283
'''
8384
85+
override protected controllerAttributes(Application it, Entity entity) '''
86+
#[IsGranted('ROLE_EDITOR')]
87+
'''
88+
8489
override protected routeMethods(Entity it) '''['POST']'''
8590
8691
override protected implBody(Application it) '''

0 commit comments

Comments
 (0)