return brix.getAuthorizationStrategy().isActionAuthorized(action);
}
private void checkForSiteRoot(JcrNode webNode) {
if (!webNode.hasNode(SITE_NODE_NAME)) {
JcrNode site = webNode.addNode(SITE_NODE_NAME, "nt:folder");
site.addMixin(BrixNode.JCR_TYPE_BRIX_NODE);
JcrNodeIterator nodes = webNode.getNodes();
while (nodes.hasNext()) {
BrixNode node = (BrixNode) nodes.nextNode();
if (node.isSame(site) == false && node instanceof GlobalContainerNode == false) {
JcrSession session = webNode.getSession();
session.move(node.getPath(), site.getPath() + "/" + node.getName());
}
}
} else {
// make reference for brix:site to brix:web to prevent creating prototypes
// without selecting brix:web
JcrNode site = webNode.getNode(SITE_NODE_NAME);
if (!site.hasProperty(Brix.NS_PREFIX + "web")) {
site.setProperty(Brix.NS_PREFIX + "web", webNode);
}
}
}