Sync with master branch

appm_improvement
Lasantha Dharmakeerthi 6 months ago
commit 918c604d72

@ -273,7 +273,7 @@ public class GroupManagementServiceImpl implements GroupManagementService {
);
return Response.status(Response.Status.OK).build();
} catch (GroupManagementException e) {
String msg = "Error occurred while adding new group.";
String msg = "Error occurred while updating group. ";
log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} catch (GroupNotExistException e) {

@ -574,7 +574,11 @@ public class RequestValidationUtil {
}
if (operationCode != null && !operationCode.isEmpty()) {
validateOperationCodeFiltering(operationCode, type);
/*
Commenting this as dynamic device types doesn't have configuration based feature manager which
used to define fixed set of operation codes.
*/
// validateOperationCodeFiltering(operationCode, type);
operationLogFilters.setOperationCode(operationCode);
}
return operationLogFilters;

@ -176,7 +176,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
+ "d.DESCRIPTION, "
+ "d.NAME, "
+ "d.LAST_UPDATED_TIMESTAMP "
+ "FROM DM_DEVICE d"
+ "FROM DM_DEVICE d WHERE "
+ "d.DEVICE_IDENTIFICATION = ? AND "
+ "d.TENANT_ID = ?";
@ -197,7 +197,6 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
int paramIndx = 1;
stmt.setString(paramIndx++, deviceData.getDeviceIdentifier().getType());
stmt.setString(paramIndx++, deviceData.getDeviceIdentifier().getId());
stmt.setInt(paramIndx++, tenantId);
if (deviceData.getLastModifiedDate() != null) {
@ -964,12 +963,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
+ "d.NAME AS DEVICE_NAME, "
+ "d.DEVICE_IDENTIFICATION, "
+ "d.LAST_UPDATED_TIMESTAMP, "
+ "e.DEVICE_TYPE "
+ "e1.DEVICE_TYPE "
+ "FROM "
+ "DM_DEVICE d, "
+ "(SELECT "
+ "e.OWNER, "
+ "e.DEVICE_TYPE "
+ "e.DEVICE_TYPE, "
+ "e.OWNERSHIP, "
+ "e.ID AS ENROLMENT_ID, "
+ "e.DEVICE_ID, "
@ -1037,12 +1036,12 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"(SELECT gd.DEVICE_ID, " +
"gd.DESCRIPTION, " +
"gd.NAME, " +
"gd.DEVICE_IDENTIFICATION, " +
"gd.DEVICE_IDENTIFICATION " +
"FROM " +
"(SELECT d.ID AS DEVICE_ID, " +
"d.DESCRIPTION, " +
"d.NAME, " +
"d.DEVICE_IDENTIFICATION, " +
"d.DEVICE_IDENTIFICATION " +
"FROM DM_DEVICE d, " +
"(SELECT dgm.DEVICE_ID " +
"FROM DM_DEVICE_GROUP_MAP dgm " +
@ -2366,7 +2365,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"e.device_id," +
"e.status, " +
"e.date_of_last_update, " +
"e.date_of_enrolment " +
"e.date_of_enrolment, " +
"e.DEVICE_TYPE " +
"FROM dm_enrolment e " +
"INNER JOIN " +
@ -2376,7 +2375,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
"KEY_FIELD = 'encryptionEnabled' " +
"AND VALUE_FIELD = ?) AS di " +
"ON di.DEVICE_ID = e.DEVICE_ID " +
"WHERE e.tenant_id = ?) e1, " +
"WHERE e.tenant_id = ?) e1 " +
"WHERE d.id = e1.device_id " +
"ORDER BY e1.date_of_last_update DESC " +
"LIMIT ? OFFSET ?";
@ -2410,7 +2409,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
try {
Connection conn = getConnection();
String sql =
"SELECT COUNT(DEVICE_ID) " +
"SELECT COUNT(DEVICE_ID) AS DEVICE_COUNT " +
"FROM DM_DEVICE_INFO " +
"WHERE KEY_FIELD = 'encryptionEnabled' " +
"AND VALUE_FIELD = ?";
@ -2418,7 +2417,6 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setBoolean(1, isEncrypted);
ps.setInt(2, tenantId);
try (ResultSet rs = ps.executeQuery()) {
return rs.next() ? rs.getInt("DEVICE_COUNT") : 0;

@ -1283,8 +1283,8 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
StringJoiner joiner = new StringJoiner(",","SELECT "
+ "d1.DEVICE_ID, "
+ "d1.DESCRIPTION, "
+ "e.DEVICE_NAME, "
+ "d1.DEVICE_TYPE, "
+ "d1.NAME AS DEVICE_NAME, "
+ "e.DEVICE_TYPE, "
+ "d1.DEVICE_IDENTIFICATION, "
+ "d1.LAST_UPDATED_TIMESTAMP, "
+ "e.OWNER, "
@ -1344,8 +1344,8 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
String sql = "SELECT "
+ "d1.DEVICE_ID, "
+ "d1.DESCRIPTION, "
+ "e.DEVICE_NAME, "
+ "d1.DEVICE_TYPE, "
+ "d1.NAME AS DEVICE_NAME, "
+ "e.DEVICE_TYPE, "
+ "d1.DEVICE_IDENTIFICATION, "
+ "d1.LAST_UPDATED_TIMESTAMP, "
+ "e.OWNER, "

@ -469,6 +469,14 @@
<DefaultRoles>Internal/devicemgt-user</DefaultRoles>
</MappedScopeDetails>
</DefaultPermission>
<DefaultPermission>
<Name>/permission/admin/device-mgt/devices/any-group/permitted-actions-under-owning-group</Name>
<MappedScopeDetails>
<Name>Apply permitted actions on any group</Name>
<Key>dm:group:any:permitted</Key>
<DefaultRoles>Internal/devicemgt-user</DefaultRoles>
</MappedScopeDetails>
</DefaultPermission>
</DefaultPermissions>
</DeviceMgtConfiguration>

Loading…
Cancel
Save