Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated checkCanCreateSchema #15618

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package io.trino.security;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.trino.metadata.QualifiedObjectName;
import io.trino.spi.TrinoException;
import io.trino.spi.connector.CatalogSchemaName;
Expand Down Expand Up @@ -60,13 +59,6 @@ public void checkCanCreateSchema(ConnectorSecurityContext context, String schema
accessControl.checkCanCreateSchema(securityContext, getCatalogSchemaName(schemaName), properties);
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
checkArgument(context == null, "context must be null");
accessControl.checkCanCreateSchema(securityContext, getCatalogSchemaName(schemaName), ImmutableMap.of());
}

@Override
public void checkCanDropSchema(ConnectorSecurityContext context, String schemaName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ default void checkCanCreateSchema(ConnectorSecurityContext context, String schem
denyCreateSchema(schemaName);
}

/**
* Check if identity is allowed to create the specified schema.
*
* @throws io.trino.spi.security.AccessDeniedException if not allowed
*/
@Deprecated
default void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
denyCreateSchema(schemaName);
}

/**
* Check if identity is allowed to drop the specified schema.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,6 @@ default void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaNa
denyCreateSchema(schema.toString());
}

/**
* Check if identity is allowed to create the specified schema in a catalog.
*
* @throws AccessDeniedException if not allowed
*/
@Deprecated
default void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
denyCreateSchema(schema.toString());
}

/**
* Check if identity is allowed to drop the specified schema in a catalog.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ public void checkCanCreateSchema(ConnectorSecurityContext context, String schema
}
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
delegate.checkCanCreateSchema(context, schemaName);
}
}

@Override
public void checkCanDropSchema(ConnectorSecurityContext context, String schemaName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ public void checkCanCreateSchema(ConnectorSecurityContext context, String schema
{
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
}

@Override
public void checkCanDropSchema(ConnectorSecurityContext context, String schemaName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaNam
{
}

@Override
public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
}

@Override
public void checkCanDropSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ public FileBasedAccessControl(CatalogName catalogName, AccessControlRules rules)

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName, Map<String, Object> properties)
{
checkCanCreateSchema(context, schemaName);
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
if (!isSchemaOwner(context, schemaName)) {
denyCreateSchema(schemaName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,6 @@ public Set<String> filterCatalogs(SystemSecurityContext context, Set<String> cat

@Override
public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema, Map<String, Object> properties)
{
checkCanCreateSchema(context, schema);
}

@Override
public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
if (!isSchemaOwner(context, schema)) {
denyCreateSchema(schema.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ public void checkCanCreateSchema(ConnectorSecurityContext context, String schema
delegate().checkCanCreateSchema(context, schemaName, properties);
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
delegate().checkCanCreateSchema(context, schemaName);
}

@Override
public void checkCanDropSchema(ConnectorSecurityContext context, String schemaName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaNam
delegate().checkCanCreateSchema(context, schema, properties);
}

@Override
public void checkCanCreateSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
delegate().checkCanCreateSchema(context, schema);
}

@Override
public void checkCanDropSchema(SystemSecurityContext context, CatalogSchemaName schema)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ public void checkCanCreateSchema(ConnectorSecurityContext context, String schema
{
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
}

@Override
public void checkCanDropSchema(ConnectorSecurityContext context, String schemaName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ public SqlStandardAccessControl(

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName, Map<String, Object> properties)
{
checkCanCreateSchema(context, schemaName);
}

@Override
public void checkCanCreateSchema(ConnectorSecurityContext context, String schemaName)
{
if (!isAdmin(context)) {
denyCreateSchema(schemaName);
Expand Down