SimpleModelGeometryCheckJobPermissionCheck.txt
/*
* SimpleModelGeometryCheckPermissionCheck.java
*
* Created on January 10, 2008
*/
package com.acme;
import com.osm.automation.IJobPermissionCheck;
import com.osm.biz.WMElement;
import com.osm.datamgmt.biz.Model;
import com.osm.exception.WMException;
public class SimpleModelGeometryCheckJobPermissionCheck implements IJobPermissionCheck {
public void checkJobExecutionAllowed(WMElement wmElement)
throws WMException {
final boolean ok = (wmElement instanceof Model) && ((Model) wmElement).isModelpart();
if (!ok) {
throw new WMException("Permission denied");
}
}
}