How to get if the user has read permission on a given path using code. | Community
Skip to main content
Level 2
October 16, 2015
Solved

How to get if the user has read permission on a given path using code.

  • October 16, 2015
  • 1 reply
  • 737 views

I want to get if the logged-in user has read permission to a specified path. Please suggest to achieve it via code.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kumaranf

try this: 

session.checkPermission("/content/someNodePath", "read");

Ref: http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#checkPermission(java.lang.String, java.lang.String)

1 reply

kumaranfAccepted solution
Level 2
October 16, 2015

try this: 

session.checkPermission("/content/someNodePath", "read");

Ref: http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#checkPermission(java.lang.String, java.lang.String)