Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Acl example
/** @var Shopware_Components_Auth $auth */
$auth
=
Shopware
(
)
->
Container
(
)
->
get
(
'auth'
)
;
if
(
$auth
->
hasIdentity
(
)
)
{
$auth
->
refresh
(
)
;
}
$this
->
initLocale
(
)
;
if
(
$auth
->
hasIdentity
(
)
)
{
$identity
=
$auth
->
getIdentity
(
)
;
$this
->acl =
Shopware
(
)
->
Acl
(
)
;
$this
->aclRole =
$identity
->role;
if
(
!
$this
->acl->
has
(
$this
->aclResource
)
)
{
return
$auth
;
}
$actionName
=
$this
->request->
getActionName
(
)
;
if
(
$this
->action instanceof Shopware_Controllers_Backend_ExtJs
)
{
$rules
=
$this
->action->
getAclRules
(
)
;
}
if
(
isset
(
$rules
[
$actionName
]
)
)
{