private function getRealPermissions(array $permissions, $subject = null, $field = null)
    {
        if (null !== $subject && $this->hasConfig($subject->getType())) {
            $config = $this->getConfig($subject->getType());

            if (null !== $field && $config->hasField($field)) {
                $config = $config->getField($field);
            }

            foreach ($permissions as $key => &$permission) {
                $permission = $config->getMappingPermission($permission);
            }
        }

        return $permissions;
    }