phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twdsilva <...@git.apache.org>
Subject [GitHub] phoenix pull request #289: PHOENIX-4528 PhoenixAccessController checks permi...
Date Tue, 16 Jan 2018 21:37:04 GMT
Github user twdsilva commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/289#discussion_r161893623
  
    --- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java
---
    @@ -267,4 +267,26 @@ public void testMultiTenantTables() throws Exception {
             verifyAllowed(readMultiTenantTableWithIndex(VIEW1_TABLE_NAME, "o1"), regularUser2);
             verifyAllowed(readMultiTenantTableWithoutIndex(VIEW2_TABLE_NAME, "o2"), regularUser2);
         }
    +
    +    /**
    +     * Grant RX permissions on the schema to regularUser1,
    +     * Creating view on a table with that schema by regularUser1 should be allowed
    +     */
    +    @Test
    +    public void testCreateViewOnTableWithRXPermsOnSchema() throws Exception {
    +
    +        startNewMiniCluster();
    +        grantSystemTableAccess(superUser1, regularUser1, regularUser2, regularUser3);
    +
    +        if(isNamespaceMapped) {
    +            verifyAllowed(createSchema(SCHEMA_NAME), superUser1);
    +            verifyAllowed(createTable(FULL_TABLE_NAME), superUser1);
    +            verifyAllowed(grantPermissions("RX", regularUser1, SCHEMA_NAME, true), superUser1);
    +        } else {
    +            verifyAllowed(createTable(FULL_TABLE_NAME), superUser1);
    +            verifyAllowed(grantPermissions("RX", regularUser1, surroundWithDoubleQuotes(SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE),
true), superUser1);
    +        }
    +
    +        verifyAllowed(createView(VIEW1_TABLE_NAME, FULL_TABLE_NAME), regularUser1);
    +    }
    --- End diff --
    
    +1 Please file a separate JIRA to add a test for the index codepath.


---

Mime
View raw message