3 Replies Latest reply on Jan 12, 2012 3:05 PM by Randall Hauch

    Question on Security and Roles

    Jonathan Fields Novice

      Hi All,

       

      I'm using Modeshape 2.7, the JBoss 6 kit, and JAAS Login config (modeshape-{users,roles}.properties).

       

      I have configured two repositories, rep1 and rep2. I have also configured two users, user1 and user2. I have this in my roles file:

       

      admin=connect,readonly,readwrite

      user1=connect.rep1, readonly.rep1, readwrite.rep1

      user2=connect.rep2, readonly.rep2, readwrite.rep2

       

      When I attempt Repository.login() as user1, I get an exception

      javax.jcr.LoginException: "default" is not a valid workspace name for the "store1" repository

          at org.modeshape.jcr.JcrRepository.sessionForContext(JcrRepository.java:1563) [:2.7.0.Final]

          at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1480) [:2.7.0.Final]

          at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:1423) [:2.7.0.Final]

      ...

      Caused by: java.security.AccessControlException: Permission denied to perform actions "read" on path <unknown>

          at org.modeshape.jcr.JcrSession.checkPermission(JcrSession.java:442) [:2.7.0.Final]

          at org.modeshape.jcr.JcrRepository.sessionForContext(JcrRepository.java:1561) [:2.7.0.Final]

       

      I can, however, login successfully as the admin user....

       

      From what I am reading here:

       

      https://docs.jboss.org/author/display/MODE27/Using+the+JCR+API+with+ModeShape#UsingtheJCRAPIwithModeShape-JCRSecurity

       

      I think this should work. Or am I misunderstanding something?

       

      Thanks,

      Jon