XWikiDocument doc = context.getWiki().getDocument(extension, context);
if (context.getWiki().getRightService().hasProgrammingRights(doc, context)) {
extensions.add(extension);
}
} catch (XWikiException e1) {
<BUG>LOG.error("Error while adding JS extension [" + extension

+ "] as always used. It will be ignored", e1);
</BUG>
}

XWikiDocument doc = context.getWiki().getDocument(extension, context);
if (context.getWiki().getRightService().hasProgrammingRights(doc, context)) {
extensions.add(extension);
