@Sonam_Chauhan This is definitely possible and can be achieved with a simple piece of code. Here are the steps:
- Create a new group called RoUsersGroup.
- Add your users to this group. Also add them to the Developers group.
- Create a new package and add a startup service to this package.
- The code for the startup service should look like below. This will allow these users to see the code. They can even change it, if they are using local development. But they will not be able to save it. So, the server will always have the original version.
InvokeManager.getDefault().registerProcessor(new InvokeChainProcessor() {
public void process(Iterator chain, BaseService baseService, IData pipeline, ServiceStatus status) throws ServerException {
String serviceName = baseService.getNSName().getFullName();
if ( serviceName.equals("wm.server.ns:putNode")|| serviceName.equals("wm.server.ns:lockNode")) {
User currentUser = InvokeState.getCurrentUser();
if (!currentUser.isAdministrator()) {
if (currentUser.hasMember("RoUsersGroup")) {
throw new ServerException("User is not allowed to make changes to server nodes");
}
}
}
if (chain.hasNext()) {
((InvokeChainProcessor) chain.next()).process(chain, baseService, pipeline, status);
}
}
});
Off course, you will also need a shutdown service to remove this processor, just in case somebody reloads the package and causes multiple processors to register. Let me know if you need the actual project/package that can do this. I am not sharing it here as I use my own Designer plugin for java development and exporting that will not work without the plugin. But I can clean it up and share it.
Rupinder Singh
#webMethods#Integration-Server-and-ESB