use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventDao method savePreRelationalData.
public void savePreRelationalData(EventInstance vo) {
MangoPermission readPermission = permissionService.findOrCreate(vo.getReadPermission());
vo.setReadPermission(readPermission);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventHandlerDao method mapRecord.
@Override
@NonNull
public AbstractEventHandlerVO mapRecord(@NonNull Record record) {
AbstractEventHandlerVO h = (AbstractEventHandlerVO) SerializationHelper.readObjectInContextFromArray(record.get(table.data));
h.setId(record.get(table.id));
h.setXid(record.get(table.xid));
h.setAlias(record.get(table.alias));
h.setDefinition(ModuleRegistry.getEventHandlerDefinition(record.get(table.eventHandlerType)));
MangoPermission read = new MangoPermission(record.get(table.readPermissionId));
h.supplyReadPermission(() -> read);
MangoPermission edit = new MangoPermission(record.get(table.editPermissionId));
h.supplyEditPermission(() -> edit);
// Ensure the recipient list is clean
switch(h.getHandlerType()) {
case EmailEventHandlerDefinition.TYPE_NAME:
EmailEventHandlerVO ehVo = (EmailEventHandlerVO) h;
mailingListDao.cleanRecipientList(ehVo.getActiveRecipients());
mailingListDao.cleanRecipientList(ehVo.getEscalationRecipients());
mailingListDao.cleanRecipientList(ehVo.getInactiveRecipients());
break;
}
return h;
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class JsonDataDao method savePreRelationalData.
@Override
public void savePreRelationalData(JsonDataVO existing, JsonDataVO vo) {
MangoPermission readPermission = permissionService.findOrCreate(vo.getReadPermission());
vo.setReadPermission(readPermission);
MangoPermission editPermission = permissionService.findOrCreate(vo.getEditPermission());
vo.setEditPermission(editPermission);
}
Aggregations