mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

Mathesar doesn't support scenario where role has no select on table but on table columns

Open pavish opened this issue 4 months ago • 0 comments

Description

  • Create a table.
    • Lets say: "Table 1", with columns "id", "somecolumn", and "anothercolumn".
  • Grant select to a different role to specific columns in that table, but on entirely on the table.
    grant select(id), SELECT (somecolumn) on "Table 1" to mathesar;
    
  • Query that table from psql. Notice that the query works as expected. The granted columns are returned and the column without privilege throws an error when selected.
    dbtest1=> select id, somecolumn from "Table 1";
    id | somecolumn 
    ----+------------
     1 | 
     2 | 
     3 | 
     4 | 
     5 | 
    (5 rows)
    
    dbtest1=> select id, somecolumn, anothercolumn from "Table 1";
    ERROR:  permission denied for table Table 1
    
    
  • Now, open the table in Mathesar. Notice the following empty page:
  • Screenshot 2024-10-02 at 6 25 35 PM

Expected

  • We should be able to view the table in this scenario.

pavish avatar Oct 02 '24 12:10 pavish