protected function mapAttributesToRoles($class, $attributes)
    {
        $mappedAttributes = array();
        foreach ($this->pool->getAdminClasses() as $adminClass => $adminCodes) {
            if ($class === $adminClass || $class instanceof $adminClass) {
                foreach ($adminCodes as $adminCode) {
                    $admin = $this->pool->getAdminByAdminCode($adminCode);
                    $baseRole = $this->securityHandler->getBaseRole($admin);

                    foreach ($attributes as $attr) {
                        if ($this->supportsAttribute($attr)) {
                            $mappedAttributes[] = sprintf($baseRole, $attr);
                        }
                    }
                }
            }
        }

        return $mappedAttributes;
    }