|
|
|
@ -301,7 +301,7 @@ public class AdminController extends BaseController { |
|
|
|
@PostMapping("/repositorySettings") |
|
|
|
public DeferredResult<RepositorySettings> saveRepositorySettings(@RequestBody RepositorySettings settings) throws ThingsboardException { |
|
|
|
accessControlService.checkPermission(getCurrentUser(), Resource.VERSION_CONTROL, Operation.WRITE); |
|
|
|
settings.setLocalOnly(false); // overriding, since local repositories are supported only for testing
|
|
|
|
settings.setLocalOnly(false); // only to be used in tests
|
|
|
|
ListenableFuture<RepositorySettings> future = versionControlService.saveVersionControlSettings(getTenantId(), settings); |
|
|
|
return wrapFuture(Futures.transform(future, savedSettings -> { |
|
|
|
savedSettings.setPassword(null); |
|
|
|
@ -330,7 +330,7 @@ public class AdminController extends BaseController { |
|
|
|
@Parameter(description = "A JSON value representing the Repository Settings.") |
|
|
|
@RequestBody RepositorySettings settings) throws Exception { |
|
|
|
accessControlService.checkPermission(getCurrentUser(), Resource.VERSION_CONTROL, Operation.READ); |
|
|
|
settings = checkNotNull(settings); |
|
|
|
settings.setLocalOnly(false); // only to be used in tests
|
|
|
|
return wrapFuture(versionControlService.checkVersionControlAccess(getTenantId(), settings), vcRequestTimeout); |
|
|
|
} |
|
|
|
|
|
|
|
@ -483,4 +483,5 @@ public class AdminController extends BaseController { |
|
|
|
adminSettingsService.saveAdminSettings(TenantId.SYS_TENANT_ID, adminSettings); |
|
|
|
response.sendRedirect(prevUri); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|