jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Zdila <m.zd...@mwaysolutions.com>
Subject nested predicate
Date Fri, 09 May 2008 08:51:04 GMT
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:aclEntry[@gfr:permission and 1 = 1]/element(gfr:sid, gfr:PrincipalSid)/@gfr:principal
= 'martin' or
	gfr:acl/gfr:aclEntries/gfr:aclEntry[@gfr:permission and 1 = 1]/element(gfr:sid, gfr:GrantedAuthoritySid)/@gfr:grantedAuthority
= 'ROLE_ADMIN' or
	gfr:acl/gfr:aclEntries/gfr:aclEntry[@gfr: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:m.zdila@mwaysolutions.com
http://www.mwaysolutions.com
xmpp:zdila@jabbim.sk (Jabber)
skype:m.zdila

Mime
View raw message