Hello,
if you're using the same group-File for different usages of the CMS_INPUT_PERMISSION component then a change in the groups-file would affect all of those usages of course. If you want different groups in the CMS_INPUT_PERMISSION then you'd have to create multiple group-files in the permission service. To sync the groups to the file you could just create a server-schedule-entry that runs automatically every x minutes/hours/days to sync the groups to the file. In the schedule entry just get the xml-Files from the service and update them by adding all groups of the project. Something like this (untested):
final String XML_DOCUMENT_INFO = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
Path projectPath= new File("conf/modules/System.PermissionService/editorgroups.xml").toPath();
// Write groups to file
StringBuffer xmlOut = new StringBuffer(XML_DOCUMENT_INFO);
xmlOut.append("<GROUPS name=\"editorgroups\" version=\"1\">\n");
for (Group group : project.getGroups()) {
String uid = group.getName().toLowerCase().replaceAll(" ","_");
xmlOut.append("\t<GROUP id=\"").append(uid).append("\" name=\"").append(group.getName()).append("\"/>\n");
}
xmlOut.append("</GROUPS>\n");
Files.write(projectPath, xmlOut.toString().getBytes(), StandardOpenOption.CREATE, StandardOpenOption.WRITE);
I think you can get the conf-path of the service from the service directly instead of adding it hardcoded. And of course there are better ways to write the xml-markup instead of hardcoded strings.
Maybe you have to always increase the version by 1 to make the service recognize the change - Maybe you could use a timestamp as version or sth. like that.
best regards
Felix