mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#6303 do not remove default user team (#3609)
* dbeaver/pro#6303 do not remove default user team * dbeaver/pro#6303 throw error --------- Co-authored-by: kseniaguzeeva <112612526+kseniaguzeeva@users.noreply.github.com>
This commit is contained in:
co-authored by
kseniaguzeeva
parent
58c4744aa7
commit
57e77b7cd1
+8
-1
@@ -411,7 +411,14 @@ public class CBEmbeddedSecurityController<T extends ServletAuthApplication>
|
||||
@NotNull Connection dbCon,
|
||||
@NotNull String userId,
|
||||
@NotNull String[] teamIds
|
||||
) throws SQLException {
|
||||
) throws SQLException, DBCException {
|
||||
String defaultTeam = getDefaultUserTeam();
|
||||
if (ArrayUtils.contains(teamIds, defaultTeam)) {
|
||||
throw new SMException("Cannot delete default user team: " + defaultTeam);
|
||||
}
|
||||
if (ArrayUtils.isEmpty(teamIds)) {
|
||||
return;
|
||||
}
|
||||
String deleteUserTeamsSql = "DELETE FROM {table_prefix}CB_USER_TEAM WHERE USER_ID=? " +
|
||||
"AND TEAM_ID IN (" + SQLUtils.generateParamList(teamIds.length) + ")";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user