Merge branch 'devel' of https://github.com/dbeaver/cloudbeaver into devel

This commit is contained in:
Wroud
2022-07-19 22:33:27 +03:00
4 changed files with 48 additions and 1 deletions
+7 -1
View File
@@ -31,6 +31,12 @@ dist/
/idea/
.idea/
## Mac OS
.DS_Store
## tests
server/test/io.cloudbeaver.test.platform/workspace/.data/
## Eclipse configs
.project
@@ -38,4 +44,4 @@ dist/
.settings/
deploy/cloudbeaver
server/**/target
server/**/target
@@ -17,6 +17,7 @@
package io.cloudbeaver.model.session;
import io.cloudbeaver.DBWConstants;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.user.WebUser;
import org.jkiss.code.NotNull;
@@ -149,6 +150,12 @@ public class WebUserContext implements SMCredentialsProvider {
} else {
this.userPermissions = getDefaultPermissions();
}
if (userPermissions != null &&
!userPermissions.isEmpty() &&
!userPermissions.contains(DBWConstants.PERMISSION_PUBLIC))
{
userPermissions.add(DBWConstants.PERMISSION_PUBLIC);
}
}
public synchronized String getSmSessionId() {
@@ -795,6 +795,9 @@ public class CBApplication extends BaseWebApplication implements WebAuthApplicat
}
protected void saveRuntimeConfig(String newServerName, String newServerURL, long sessionExpireTime, CBAppConfig appConfig) throws DBException {
if (newServerName == null) {
throw new DBException("Invalid server configuration, server name cannot be empty");
}
Map<String, Object> configurationProperties = collectConfigurationProperties(newServerName, newServerURL, sessionExpireTime, appConfig);
writeRuntimeConfig(configurationProperties);
}
@@ -0,0 +1,31 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2022 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cloudbeaver.service.rm;
/**
* RM constants
*/
public interface RMConstants {
String PERMISSION_PROJECT_VIEW = "project-view";
String PERMISSION_PROJECT_EDIT = "project-edit";
String PERMISSION_PROJECT_ADMIN = "project-admin";
// RM admin can create/delete projects. It also can assign project permissions.
String PERMISSION_RM_ADMIN = "rm-admin";
}