public function isAllowed($modulePath)
    {
        $modulePathSegments = explode('/', $modulePath);
        $moduleConfiguration = Arrays::getValueByPath($this->modules, implode('.submodules.', $modulePathSegments));

        if (!$this->privilegeManager->isGranted(ModulePrivilege::class, new ModulePrivilegeSubject($modulePath))) {
            return false;
        }

        // @deprecated since Neos 3.2, use the ModulePrivilegeTarget instead!
        if (isset($moduleConfiguration['privilegeTarget']) && !$this->privilegeManager->isPrivilegeTargetGranted($moduleConfiguration['privilegeTarget'])) {
            return false;
        }

        return true;
    }
public function isAllowed($modulePath)
    {
        $modulePathSegments = explode('/', $modulePath);
        $moduleConfiguration = Arrays::getValueByPath($this->modules, implode('.submodules.', $modulePathSegments));

        if (!$this->privilegeManager->isGranted(ModulePrivilege::class, new ModulePrivilegeSubject($modulePath))) {
            return false;
        }

        // @deprecated since Neos 3.2, use the ModulePrivilegeTarget instead!
        if (isset($moduleConfiguration['privilegeTarget']) && !$this->privilegeManager->isPrivilegeTargetGranted($moduleConfiguration['privilegeTarget'])) {
            return false;
        }

        return true;
    }
public function isAllowed ( $ modulePath ) { $ modulePathSegments = explode ( '/' , $ modulePath ) ; $ moduleConfiguration = Arrays :: getValueByPath ( $ this -> modules , implode ( '.submodules.' , $ modulePathSegments ) ) ; if ( ! $ this -> privilegeManager -> isGranted ( ModulePrivilege :: class , new ModulePrivilegeSubject ( $ modulePath ) ) ) { return false ; } // @deprecated since Neos 3.2, use the ModulePrivilegeTarget instead! if ( isset ( $ moduleConfiguration [ 'privilegeTarget' ] ) && ! $ this -> privilegeManager -> isPrivilegeTargetGranted ( $ moduleConfiguration [ 'privilegeTarget' ] ) ) { return false ; } return true ; }
Checks whether the current user has access to a module

@param string $modulePath
@return boolean
Checks whether the current user has access to a module