use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by MangoAutomation.
the class EventInstanceDao method deletePostRelationalData.
@Override
public void deletePostRelationalData(EventInstanceVO vo) {
MangoPermission readPermission = vo.getReadPermission();
permissionService.deletePermissions(readPermission);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by MangoAutomation.
the class FileStoreDao method savePreRelationalData.
@Override
public void savePreRelationalData(FileStore existing, FileStore vo) {
MangoPermission readPermission = permissionService.findOrCreate(vo.getReadPermission());
vo.setReadPermission(readPermission);
MangoPermission writePermission = permissionService.findOrCreate(vo.getWritePermission());
vo.setWritePermission(writePermission);
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by MangoAutomation.
the class FileStoreDao method mapRecord.
@Override
public FileStore mapRecord(Record record) {
FileStore result = new FileStore();
result.setId(record.get(table.id));
result.setXid(record.get(table.xid));
result.setName(record.get(table.name));
result.setReadPermission(new MangoPermission(record.get(table.readPermissionId)));
result.setWritePermission(new MangoPermission(record.get(table.writePermissionId)));
return result;
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by MangoAutomation.
the class JsonDataDao method mapRecord.
@Override
public JsonDataVO mapRecord(Record record) {
JsonDataVO vo = new JsonDataVO();
vo.setId(record.get(table.id));
vo.setXid(record.get(table.xid));
vo.setName(record.get(table.name));
vo.setJsonData(extractDataFromObject(record.get(table.data)));
vo.setReadPermission(new MangoPermission(record.get(table.readPermissionId)));
vo.setEditPermission(new MangoPermission(record.get(table.editPermissionId)));
return vo;
}
use of com.infiniteautomation.mango.permission.MangoPermission in project ma-core-public by MangoAutomation.
the class SystemPermissionDao method update.
/**
* Update the permission
*/
public void update(String permissionTypeName, MangoPermission existing, MangoPermission permission) {
if (!existing.equals(permission)) {
permissionService.deletePermissions(existing);
}
MangoPermission toUpdate = permissionService.findOrCreate(permission);
this.create.update(SYSTEM_PERMISSIONS).set(SYSTEM_PERMISSIONS.permissionId, toUpdate.getId()).where(SYSTEM_PERMISSIONS.permissionType.eq(permissionTypeName)).execute();
}
Aggregations