hello

i am storing ACL entries to JCR and i need to create query that returns all 
permitted nodes:

/jcr:root/gfr:system/gfr:channels/gfr:channel
[
        gfr:acl/gfr:aclEntries/gfr:[EMAIL PROTECTED]:permission and 1 = 
1]/element(gfr:sid, gfr:PrincipalSid)/@gfr:principal = 'martin' or
        gfr:acl/gfr:aclEntries/gfr:[EMAIL PROTECTED]:permission and 1 = 
1]/element(gfr:sid, gfr:GrantedAuthoritySid)/@gfr:grantedAuthority = 
'ROLE_ADMIN' or
        gfr:acl/gfr:aclEntries/gfr:[EMAIL PROTECTED]:permission and 1 = 
1]/element(gfr:sid, gfr:GrantedAuthoritySid)/@gfr:grantedAuthority = 'ROLE_USER'
]

unfortunately i am getting javax.jcr.query.InvalidQueryException: Unsupported 
location for predicate

is there something wrong with my query? doesn't jackrabbit support nested 
predicates?
any idea how to rewrite my query to get expected result?

my node structure is:

+ gfr:channels
  + gfr:channel // multiple times
    + gfr:acl
      + gfr:aclEntries
        + gfr:aclEntry // multiple times
          - gfr:permission (long) // permissions as bit array
          + gfr:sid (nodeType = gfr:PrincipalSid or gfr:GrantedAuthoritySid)
            - @gfr:principal or @gfr:grantedAuthority // name of the SID
        + gfr:aclEntry ...
  + gfr:channel ...

thanks in advance.
-- 
Martin Zdila 
CTO

M-Way Solutions Slovakia s.r.o.
Letna 27, 040 01 Kosice
Slovakia

tel:+421-908-363-848
mailto:[EMAIL PROTECTED]
http://www.mwaysolutions.com
xmpp:[EMAIL PROTECTED] (Jabber)
skype:m.zdila

Reply via email to