You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "bereng (via GitHub)" <gi...@apache.org> on 2023/02/14 09:28:37 UTC

[GitHub] [cassandra] bereng commented on a diff in pull request #2146: CASSANDRA-18070 trunk: Add SELECT_MASKED permission

bereng commented on code in PR #2146:
URL: https://github.com/apache/cassandra/pull/2146#discussion_r1105523842


##########
src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:
##########
@@ -238,7 +239,21 @@ public void authorize(ClientState state) throws InvalidRequestException, Unautho
         for (Function function : getFunctions())
             state.ensurePermission(Permission.EXECUTE, function);
 
-        unmask = state.hasUnmaskPermission(table);
+        unmask = state.hasTablePermission(table, Permission.UNMASK);
+
+        if (!unmask && !state.hasTablePermission(table, Permission.SELECT_MASKED))
+        {
+            List<ColumnMetadata> queriedMaskedColumns = table.columns()
+                                                             .stream()
+                                                             .filter(ColumnMetadata::isMasked)

Review Comment:
   Would it be better to filter `isRestricted` first?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org