Skip to content
Open
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 @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
Loading