Open sp-yang opened 4 weeks ago
@sp-yang can you provide more details on what's not working? I'm don't think we use any EE only features right now. Most of the work is done in the python code anyhow.
@jexp For example, in backend/src/graphDB_dataAccess.py, the function check_account_access() uses command " SHOW USER PRIVILEGES YIELD WHERE graph = $database AND action IN ['read'] RETURN COUNT() AS readAccessCount", which is only supported by Neo4j EE version. CE version will throw an exception.
@jexp For example, in backend/src/graphDB_dataAccess.py, the function check_account_access() uses command " SHOW USER PRIVILEGES YIELD WHERE graph = $database AND action IN ['read'] RETURN COUNT() AS readAccessCount", which is only supported by Neo4j EE version. CE version will throw an exception.
I have the same error message with the current version. When I revert to a working tree that has the previous version, no errors.
I agree this would be nice to have! I suspect maybe it's somehow inferring that the user doesn't have edit permissions in the community edition, because the roles show as null, but in reality, per this documentation, "In Neo4j Community Edition there are no roles, but all users have implied administrator privileges."
Good point. This is a recent addition that we can fix.
The workaround is just return true when Exception occured.
def check_account_access(self, database):
query = """
SHOW USER PRIVILEGES
YIELD *
WHERE graph = $database AND action IN ['read']
RETURN COUNT(*) AS readAccessCount
"""
try:
logging.info(f"Checking access for database: {database}")
result = self.graph.query(query, params={"database": database})
read_access_count = result[0]["readAccessCount"] if result else 0
logging.info(f"Read access count: {read_access_count}")
if read_access_count > 0:
logging.info("The account has read access.")
return False
else:
logging.info("The account has write access.")
return True
except Exception as e:
logging.error(f"Error checking account access: {e}")
return True # False
The current up-to-date version of graph builder does not work with Neo4J Community Edition, e.g. some commands are not supported by Neo4j community edition. Please adapt it to neo4j community editon as much as you can. Thanks!