use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventDao method deletePostRelationalData.
public void deletePostRelationalData(EventInstance vo) {
MangoPermission readPermission = vo.getReadPermission();
permissionService.deletePermissions(readPermission);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class DataSourceDao method deletePostRelationalData.
@Override
public void deletePostRelationalData(DataSourceVO vo) {
// Clean permissions
MangoPermission readPermission = vo.getReadPermission();
MangoPermission editPermission = vo.getEditPermission();
permissionService.deletePermissions(readPermission, editPermission);
vo.getDefinition().deletePostRelationalData(vo);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventDao method mapRecord.
public EventInstance mapRecord(Record record) {
EventType type = createEventType(record);
EventInstance event = new EventInstance(type, record.get(table.activeTs), charToBool(record.get(table.rtnApplicable)), AlarmLevels.fromValue(record.get(table.alarmLevel)), BaseDao.readTranslatableMessage(record.get(table.message)), null);
event.setId(record.get(table.id));
Long rtnTs = record.get(table.rtnTs);
if (rtnTs != null)
event.returnToNormal(rtnTs, ReturnCause.fromValue(record.get(table.rtnCause)));
MangoPermission read = new MangoPermission(record.get(table.readPermissionId));
event.supplyReadPermission(() -> read);
Long ackTs = record.get(table.ackTs);
if (ackTs != null) {
event.setAcknowledgedTimestamp(ackTs);
Integer ackUserId = record.get(table.ackUserId);
if (ackUserId != null)
event.setAcknowledgedByUsername(record.get(userTable.username));
event.setAlternateAckSource(BaseDao.readTranslatableMessage(record.get(table.alternateAckSource)));
}
Integer cnt = (Integer) record.get("cnt");
event.setHasComments(cnt != null && cnt > 0);
return event;
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventHandlerDao method deletePostRelationalData.
@Override
public void deletePostRelationalData(AbstractEventHandlerVO vo) {
vo.getDefinition().deletePostRelationalData(vo);
// Clean permissions
MangoPermission readPermission = vo.getReadPermission();
MangoPermission editPermission = vo.getEditPermission();
permissionService.deletePermissions(readPermission, editPermission);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by infiniteautomation.
the class EventHandlerDao method loadRelationalData.
@Override
public void loadRelationalData(AbstractEventHandlerVO vo) {
vo.setEventTypes(getEventTypesForHandler(vo.getId()));
vo.getDefinition().loadRelationalData(vo);
// Populate permissions
MangoPermission read = vo.getReadPermission();
vo.supplyReadPermission(() -> permissionService.get(read.getId()));
MangoPermission edit = vo.getEditPermission();
vo.supplyEditPermission(() -> permissionService.get(edit.getId()));
}
Aggregations