X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.jcr%2Fsrc%2Forg%2Fargeo%2Fcms%2Fjcr%2Facr%2FJcrContent.java;fp=org.argeo.cms.jcr%2Fsrc%2Forg%2Fargeo%2Fcms%2Fjcr%2Facr%2FJcrContent.java;h=68eaf3e50cd38d862d71e0d59e8aac68ca71e4ce;hb=d0099aa2fc4123ad4191baba379c1f4836ff8054;hp=612eea89123e785a746ef6358951701a11b0691d;hpb=4a827f36e40e2e25ee1400641918a0b30f2831c1;p=gpl%2Fargeo-jcr.git diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java index 612eea8..68eaf3e 100644 --- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java +++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java @@ -21,6 +21,7 @@ import javax.jcr.Property; import javax.jcr.PropertyIterator; import javax.jcr.PropertyType; import javax.jcr.RepositoryException; +import javax.jcr.Session; import javax.jcr.Value; import javax.jcr.nodetype.NodeType; import javax.xml.namespace.QName; @@ -242,6 +243,9 @@ public class JcrContent extends AbstractContent { } + /* + * ACCESS + */ boolean exists() { try { return provider.getJcrSession(getSession(), jcrWorkspace).itemExists(jcrPath); @@ -250,6 +254,16 @@ public class JcrContent extends AbstractContent { } } + @Override + public boolean isParentAccessible() { + String jcrParentPath = ContentUtils.getParentPath(jcrPath)[0]; + try { + return provider.getJcrSession(getSession(), jcrWorkspace).hasPermission(jcrParentPath, Session.ACTION_READ); + } catch (RepositoryException e) { + throw new JcrException("Cannot check whether parent " + jcrParentPath + " is accessible", e); + } + } + /* * ADAPTERS */ @@ -367,7 +381,7 @@ public class JcrContent extends AbstractContent { private QName nodeTypeToQName(NodeType nodeType) { String name = nodeType.getName(); return NamespaceUtils.parsePrefixedName(provider, name); - //return QName.valueOf(name); + // return QName.valueOf(name); } @Override