Neo4j Granting Access Based on Label Patterns

26 views Asked by At

How can access be granted to a given user role, enabling them to retrieve (match) records if the labels contain a specific pattern in Neo4j?

While impersonating as a user and managing existing labels like Test, Test_1, and Test_2 in the database, is there a way to configure grant permissions ensuring that records with labels containing the prefix 'Test' are accessible to the user?

2

There are 2 answers

0
Finbar Good On

When granting permissions based on node label / relationship type, you can specify all labels / types with *, or you can specify a list of label / type identifiers. But you can’t specify a pattern that would match the beginning of the label / type name.

See the docs.

2
cybersam On

A workaround is to give every node that has a label that starts with "Test" an additional shared label (say, "TestGroup"). Then you can just grant permissions to "TestGroup".