cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Combining matched relationship properties to remove duplicates

I'm trying to implement an access control graph. An account can be a member of a team that belongs one or more roles with are in turn associated with an entity. Each assoicated_with relationship has an associated permissions property, which is an array containing values e.g. ['create','edit','delete']

The problem is that the team can be in different roles that in turn access the same entity but with different permissions. e.g. the team could be in an 'Everyone' role and an 'Admin' role.

My cypher looks like:
match (a:Account{email:foo@gmail.com'})-[:MEMBER_OF]->(:Team)-[c:BELONGS_TO]->(:Role)-[p:ASSOCIATED_WITH]->(h:Entity)
return h.name,p.permissions

When combined this looks like:

How can I combine the permissions property so in this instance I only get one result returned with all permissions in it?

0 REPLIES 0