Skip to content
Snippets Groups Projects
Commit 431580e1 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor changes.

parent fc395107
Branches
Tags
No related merge requests found
...@@ -721,36 +721,36 @@ class DbConnector(object): ...@@ -721,36 +721,36 @@ class DbConnector(object):
if not conn.closed: if not conn.closed:
conn.rollback() conn.rollback()
def updateGroupRead(self, groupsToAdd, groupsToRemove, nodeVOSPath): def updateGroupRead(self, groupToAdd, groupToRemove, nodeVOSPath):
with self.getConnection() as conn: with self.getConnection() as conn:
try: try:
cursor = conn.cursor(cursor_factory = RealDictCursor) cursor = conn.cursor(cursor_factory = RealDictCursor)
cursor.execute(""" cursor.execute("""
UPDATE node c UPDATE node c
SET group_read = update_array(c.group_read, %s::VARCHAR[], %s::VARCHAR[]) SET group_read = update_array(c.group_read, %s, %s)
FROM node n FROM node n
WHERE c.path <@ n.path AND n.node_id = id_from_vos_path(%s); WHERE c.path <@ n.path AND n.node_id = id_from_vos_path(%s);
""", """,
(groupsToAdd, (groupToAdd,
groupsToRemove, groupToRemove,
nodeVOSPath,)) nodeVOSPath,))
conn.commit() conn.commit()
except Exception as e: except Exception as e:
if not conn.closed: if not conn.closed:
conn.rollback() conn.rollback()
def updateGroupWrite(self, groupsToAdd, groupsToRemove, nodeVOSPath): def updateGroupWrite(self, groupToAdd, groupToRemove, nodeVOSPath):
with self.getConnection() as conn: with self.getConnection() as conn:
try: try:
cursor = conn.cursor(cursor_factory = RealDictCursor) cursor = conn.cursor(cursor_factory = RealDictCursor)
cursor.execute(""" cursor.execute("""
UPDATE node c UPDATE node c
SET group_write = update_array(c.group_write, %s::VARCHAR[], %s::VARCHAR[]) SET group_write = update_array(c.group_write, %s, %s)
FROM node n FROM node n
WHERE c.path <@ n.path AND n.node_id = id_from_vos_path(%s); WHERE c.path <@ n.path AND n.node_id = id_from_vos_path(%s);
""", """,
(groupsToAdd, (groupToAdd,
groupsToRemove, groupToRemove,
nodeVOSPath,)) nodeVOSPath,))
conn.commit() conn.commit()
except Exception as e: except Exception as e:
......
...@@ -56,6 +56,7 @@ class GroupRwRPCServer(RedisRPCServer): ...@@ -56,6 +56,7 @@ class GroupRwRPCServer(RedisRPCServer):
jobType = requestType.split('_')[0] jobType = requestType.split('_')[0]
vospacePath = requestBody["vospacePath"] vospacePath = requestBody["vospacePath"]
groupname = requestBody["groupName"] groupname = requestBody["groupName"]
self.logger.info(f"groupName: {groupname}")
#groupInDb = self.dbConn.userExists(groupname) #groupInDb = self.dbConn.userExists(groupname)
#groupInfo = self.systemUtils.userInfo(groupname) #groupInfo = self.systemUtils.userInfo(groupname)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment