src/Sulu/Component/Security/Authorization/AccessControl/AccessControlManager.php
private function getUserObjectPermissionByArray($permissions, UserInterface $user)
    {
        if (empty($permissions)) {
            return [];
        }

        $userPermission = [];
        $roles = $user->getRoleObjects();
        foreach ($roles as $role) {
            $roleId = $role->getId();
            if (!isset($permissions[$roleId])) {
                continue;
            }

            $userPermission = $this->cumulatePermissions($userPermission, $permissions[$roleId]);
        }

        return $userPermission;
    }
private function getUserObjectPermissionByArray($permissions, UserInterface $user)
    {
        if (empty($permissions)) {
            return [];
        }

        $userPermission = [];
        $roles = $user->getRoleObjects();
        foreach ($roles as $role) {
            $roleId = $role->getId();
            if (!isset($permissions[$roleId])) {
                continue;
            }

            $userPermission = $this->cumulatePermissions($userPermission, $permissions[$roleId]);
        }

        return $userPermission;
    }
private function getUserObjectPermissionByArray ( $ permissions , UserInterface $ user ) { if ( empty ( $ permissions ) ) { return [ ] ; } $ userPermission = [ ] ; $ roles = $ user -> getRoleObjects ( ) ; foreach ( $ roles as $ role ) { $ roleId = $ role -> getId ( ) ; if ( ! isset ( $ permissions [ $ roleId ] ) ) { continue ; } $ userPermission = $ this -> cumulatePermissions ( $ userPermission , $ permissions [ $ roleId ] ) ; } return $ userPermission ; }
Returns the permissions for the given permission array and the given user.

@param array $permissions Object permissions
@param UserInterface $user The user for the check

@return array
Returns the permissions for the given permission array and the given user .