Search code examples
pocketbase

How do I add a specific user access to view a View Collection in Pocket base


I have a base collection where admin is adding data via post method (using api) and I have made a user specific view collections. My question is how do I grant only user1 access to view data from view collection of user1. I believe I have to make some custom api rules but I count not figure out how.

Any help?

Tried searching the docs but could not figure it out.


Solution

  • Yep figured it out I refined the schema. Now I have a Master collection and API rule

    @request.auth.id = user.id
    

    to view and list the records. Here, the user is the assigned user to a record. When a user creates a record it automatically assigns it.