Add explicit CREATE TABLE permission check for table designer (#2128)

This commit is contained in:
Hai Cao
2023-07-06 16:19:50 -07:00
committed by GitHub
parent 11f632aaa9
commit b9277c3830
5 changed files with 101 additions and 1 deletions

View File

@@ -12916,6 +12916,16 @@ namespace Microsoft.SqlTools.ServiceLayer
return Keys.GetString(Keys.NonClusteredColumnStoreIndexMustHaveColumnsRuleDescription, indexName);
}
public static string TableDesignerCreateTablePermissionDenied(string db)
{
return Keys.GetString(Keys.TableDesignerCreateTablePermissionDenied, db);
}
public static string TableDesignerAlterTablePermissionDenied(string table)
{
return Keys.GetString(Keys.TableDesignerAlterTablePermissionDenied, table);
}
public static string SqlProjectModelNotFound(string projectUri)
{
return Keys.GetString(Keys.SqlProjectModelNotFound, projectUri);
@@ -16871,6 +16881,12 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string TableDesignerConfirmationText = "TableDesignerConfirmationText";
public const string TableDesignerCreateTablePermissionDenied = "TableDesignerCreateTablePermissionDenied";
public const string TableDesignerAlterTablePermissionDenied = "TableDesignerAlterTablePermissionDenied";
public const string SqlProjectModelNotFound = "SqlProjectModelNotFound";

View File

@@ -5440,6 +5440,16 @@ The Query Processor estimates that implementing the following index could improv
<value>I have read the summary and understand the potential risks.</value>
<comment></comment>
</data>
<data name="TableDesignerCreateTablePermissionDenied" xml:space="preserve">
<value>CREATE TABLE permission denied in database &apos;{0}&apos;.</value>
<comment>.
Parameters: 0 - db (string) </comment>
</data>
<data name="TableDesignerAlterTablePermissionDenied" xml:space="preserve">
<value>ALTER TABLE permission denied for table &apos;{0}&apos;.</value>
<comment>.
Parameters: 0 - table (string) </comment>
</data>
<data name="SqlProjectModelNotFound" xml:space="preserve">
<value>Could not find SQL model from project: {0}.</value>
<comment>.

View File

@@ -2451,6 +2451,8 @@ HashIndexMustHaveBucketCountRuleDescription(string indexName) = Hash index '{0}'
ColumnCanOnlyAppearOnceInNonClusteredColumnStoreIndexRuleDescription(string columnName, string indexName, int rowNumber) = Column with name '{0}' has already been added to the non-clustered columnstore index '{1}'. Row number: {2}.
NonClusteredColumnStoreIndexMustHaveColumnsRuleDescription(string indexName) = Non-clustered columnstore index '{0}' does not have any columns associated with it.
TableDesignerConfirmationText = I have read the summary and understand the potential risks.
TableDesignerCreateTablePermissionDenied(string db) = CREATE TABLE permission denied in database '{0}'.
TableDesignerAlterTablePermissionDenied(string table) = ALTER TABLE permission denied for table '{0}'.
############################################################################
# TSql Model

View File

@@ -8321,6 +8321,17 @@ The Query Processor estimates that implementing the following index could improv
<target state="new">None</target>
<note></note>
</trans-unit>
<trans-unit id="TableDesignerCreateTablePermissionDenied">
<source>CREATE TABLE permission denied in database '{0}'.</source>
<target state="new">CREATE TABLE permission denied in database '{0}'.</target>
<note></note>
</trans-unit>
<trans-unit id="TableDesignerAlterTablePermissionDenied">
<source>ALTER TABLE permission denied for table '{0}'.</source>
<target state="new">ALTER TABLE permission denied for table '{0}'.</target>
<note>.
Parameters: 0 - table (string) </note>
</trans-unit>
</body>
</file>
</xliff>