Skip to content

Cannot use an RLS rule that JOINs with a private table #2830

Open
@egormanga

Description

@egormanga

Reproduction:

#[table(name=test, public)]
struct Test {
	#[primary_key]
	#[auto_inc]
	id: u64,
}

#[client_visibility_filter]
const TEST_FILTER: Filter = Filter::Sql("SELECT test.* FROM test JOIN test_access ON test.id = test_access.id WHERE user_id = :sender");

#[table(name=test_access)]
struct TestAccess {
	#[primary_key]
	id: u64,
	user_id: Identity,
}

Compiles and publishes successfully, but when querying it fails with:

`test_access` is not a valid table

Should be a pretty obvious case to add a more complex restriction logic based on some private (sensitive) fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions