use of com.serotonin.m2m2.vo.event.ScriptEventHandlerVO in project ma-core-public by infiniteautomation.
the class ScriptEventHandlerDefinition method validate.
@Override
public void validate(ProcessResult response, ScriptEventHandlerVO existing, ScriptEventHandlerVO vo) {
commonValidation(response, vo);
if (vo.getScriptRoles() == null) {
response.addContextualMessage("scriptRoles", "validate.permission.null");
} else {
PermissionHolder user = Common.getUser();
Set<Role> roles = existing.getScriptRoles() == null ? null : existing.getScriptRoles();
permissionService.validatePermissionHolderRoles(response, "scriptRoles", user, vo.getScriptRoles());
}
}
Aggregations