Skip to content

Database RLS — Ownership field dropdown ignores schema fields (only shows userId) #262

Description

@Nitin-kumar-yadav1307

Description

The Database Settings UI only shows the default userId option in the Ownership Field dropdown, even when the selected collection's model contains valid string fields such as ownerId or createdBy.

This appears to be a client-side filtering bug. The backend already supports arbitrary owner fields.


Steps to Reproduce

  1. Go to Dashboard → Database.
  2. Select a collection whose model contains a string field (e.g., ownerId).
  3. Navigate to Settings → Row-Level Security (RLS).
  4. Enable RLS.
  5. Open the Ownership Field dropdown.

Expected Behavior

The Ownership Field dropdown should list all string fields defined in the collection model, allowing administrators to select an existing schema field such as:

  • ownerId
  • createdBy
  • Other string-based ownership fields

Actual Behavior

The dropdown only displays:

  • userId (Default)

Custom schema fields are not shown.


Root Cause

The client code filters model fields using:

f.type === 'STRING'

Why This Matters

Row-Level Security (RLS) supports any owner field, and the backend already validates that the configured owner field exists in the collection schema.

The broken UI prevents administrators from selecting valid schema fields and effectively forces them to use the default userId field or rely on workarounds.


Relevant Backend References

Project.js — RLS ownerField default and storage
project.controller.js — validation that ownerField exists in the collection schema
authorizeReadOperation.js — runtime use of the configured owner field

Metadata

Metadata

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