mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-19 02:20:47 +08:00
dbeaver/pro#8757 Test connection permissions required (#4434)
* dbeaver/pro#8757 Test connection permissions required (the same as createConnection) * dbeaver/pro#8757 Anno added * dbeaver/pro#8757 restrict private project use for gql * dbeaver/pro#8757 change error message --------- Co-authored-by: Ainur <ainur.iagudin@dbeaver.com>
This commit is contained in:
+6
@@ -275,6 +275,12 @@ public abstract class WebServiceBindingBase<API_TYPE extends DBWService> impleme
|
||||
if (project == null) {
|
||||
throw new DBException("Project not found:" + projectId);
|
||||
}
|
||||
var customConnectionsEnabled =
|
||||
ServletAppUtils.getServletApplication().getAppConfiguration().isSupportsCustomConnections();
|
||||
if (!customConnectionsEnabled && project.isPrivateProject()) {
|
||||
throw new DBWebExceptionAccessDenied("Access to private project is denied");
|
||||
}
|
||||
|
||||
RMProject rmProject = project.getRMProject();
|
||||
|
||||
for (String reqProjectPermission : requireProjectPermissions) {
|
||||
|
||||
+4
-4
@@ -163,17 +163,17 @@ public interface DBWServiceCore extends DBWService {
|
||||
@NotNull Map<String, Object> connectionConfig
|
||||
) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
@WebProjectAction(requireProjectPermissions = {RMConstants.PERMISSION_PROJECT_DATASOURCES_EDIT})
|
||||
WebConnectionInfo testConnection(
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String projectId,
|
||||
@Nullable @WebObjectId String projectId,
|
||||
@NotNull Map<String, Object> connectionConfig
|
||||
) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
@WebProjectAction(requireProjectPermissions = {RMConstants.PERMISSION_PROJECT_DATASOURCES_EDIT})
|
||||
WebNetworkEndpointInfo testNetworkHandler(
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String projectId,
|
||||
@Nullable @WebObjectId String projectId,
|
||||
@Nullable String connectionId,
|
||||
@NotNull WebNetworkHandlerConfigInput nhConfig
|
||||
) throws DBWebException;
|
||||
|
||||
Reference in New Issue
Block a user