diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java index e3fc2ac9ee0..81491e63044 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java @@ -1214,12 +1214,14 @@ public void testSuperUserCanChangePerms() throws Throwable { public void testReadPermsOnTableIndexAndView() throws Exception { grantSystemTableAccess(superUser1, regularUser1, regularUser2, unprivilegedUser); - // Create new schema and grant CREATE permissions to a user + // Create new schema and grant READ, WRITE and CREATE permissions to a user. + // The owner grant on a new table reaches the region servers asynchronously. + // The schema grant lets the creator use the new table before the owner grant arrives. if (isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); - verifyAllowed(grantPermissions("C", regularUser1, schemaName, true), superUser1); + verifyAllowed(grantPermissions("RWC", regularUser1, schemaName, true), superUser1); } else { - verifyAllowed(grantPermissions("C", regularUser1, + verifyAllowed(grantPermissions("RWC", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); } @@ -1285,12 +1287,14 @@ public void testReadPermsOnTableIndexAndViewOnLowerCaseSchema() throws Exception schemaName = "\"" + schemaName.toLowerCase() + "\""; fullTableName = schemaName + "." + tableName; - // Create new schema and grant CREATE permissions to a user + // Create new schema and grant READ, WRITE and CREATE permissions to a user. + // The owner grant on a new table reaches the region servers asynchronously. + // The schema grant lets the creator use the new table before the owner grant arrives. if (isNamespaceMapped) { verifyAllowed(createSchema(schemaName), superUser1); - verifyAllowed(grantPermissions("C", regularUser1, schemaName, true), superUser1); + verifyAllowed(grantPermissions("RWC", regularUser1, schemaName, true), superUser1); } else { - verifyAllowed(grantPermissions("C", regularUser1, + verifyAllowed(grantPermissions("RWC", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE), true), superUser1); }