Hi @Prashardan you can use the setACL command in the script
setACL on /content/dam/project for group group1
allow jcr:read, jcr:modifyProperties, jcr:removeChildNodes, jcr:removeNode
deny jcr:read, rep:replicate
end
setACL on /content/dam/project for group group2
allow jcr:read, rep:replicate
end...