Backend\Modules\Authentication\Actions\Index::getAllowedModule PHP Method

getAllowedModule() private method

Run through the modules and find us a module(name) this user is allowed to access.
private getAllowedModule ( ) : boolean | string
return boolean | string
    private function getAllowedModule()
    {
        // create filter with modules which may not be displayed
        $filter = array('Authentication', 'Error', 'Core');
        // get all modules
        $modules = array_diff(BackendModel::getModules(), $filter);
        $allowedModule = false;
        if (BackendAuthentication::isAllowedModule('Dashboard')) {
            $allowedModule = 'Dashboard';
        } else {
            foreach ($modules as $module) {
                if (BackendAuthentication::isAllowedModule($module)) {
                    $allowedModule = $module;
                    break;
                }
            }
        }
        return $allowedModule;
    }