Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
fetchIntegrationPermissions example
if
(
$userId
!== null
)
{
$source
->
setPermissions
(
$this
->
fetchPermissions
(
$userId
)
)
;
$source
->
setIsAdmin
(
$this
->
isAdmin
(
$userId
)
)
;
return
$source
;
}
if
(
$integrationId
!== null
)
{
$source
->
setIsAdmin
(
$this
->
isAdminIntegration
(
$integrationId
)
)
;
$source
->
setPermissions
(
$this
->
fetchIntegrationPermissions
(
$integrationId
)
)
;
return
$source
;
}
return
$source
;
}
private
function
isAdmin
(
string
$userId
)
: bool
{
return
(bool)
$this
->connection->
fetchOne
(
'SELECT admin FROM `user` WHERE id = :id',
[