Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
initAcl example
public
function
init
(
)
{
$this
->
Front
(
)
->
Plugins
(
)
->
ScriptRenderer
(
)
->
setRender
(
)
;
$this
->
Front
(
)
->
Plugins
(
)
->
JsonRequest
(
)
->
setParseInput
(
)
->
setParseParams
(
[
'group', 'sort', 'filter'
]
)
->
setPadding
(
$this
->
Request
(
)
->
get
(
'targetField'
)
)
;
// Call controller acl rules (user - defined)
$this
->
initAcl
(
)
;
}
/** * Enable json renderer for index / load action * Checks acl rules */
public
function
preDispatch
(
)
{
if
(
!\
in_array
(
$this
->
Request
(
)
->
getActionName
(
)
,
[
'index', 'load', 'skeleton', 'extends'
]
)
)
{
$this
->
Front
(
)
->
Plugins
(
)
->
Json
(
)
->
setRenderer
(
)
;
}
}