Access control per project?

So I have two tables, one for projects and one for users. Is there a way I can filter the tables so that users can only see the projects they’re in?

Here’s a simplified version of my tables:

Link to doc: Per Project Access

Hi @Stian_Ovesen :blush: !

I think you could use a view of your table and filter it using something like :

thisRow.[Project Manager].[Coda user] = User() 
OR thisRow.Stakeholder.[Coda user] = User()

This tells the filter to keep the rows where either the User() has been set as Project Manager or Stakeholder :blush:

For your [DB Users], you would just need to filter the view by your field [Coda user].
Coda will allow you to select Current user in the options :innocent:

The formula behind this filter is :

thisRow.[Coda user].Contains(User())

which you could also use :blush: .

This should work too :

thisRow.[Coda user] = User()

Hope this helps :blush:


That worked like a charm, @Pch! And so simple! To think I’ve been bashing my head against this for over an hour.

I discovered a problem. The filter breaks if there are more than one stakeholder or project manager. Will update if I figure out how to work around it.

Nevermind. I just made a mistake.

No problem @Stian_Ovesen :grin: ! I’m very glad to know it worked :raised_hands: !

Just in case, if you use multi-select lookups to be able to select multiple Project Managers / Stakeholders, you could use this filter formula :innocent: :

thisRow.[Project Manager].[Coda user].Contains(User()) 
OR thisRow.Stakeholder.[Coda user].Contains(User())

(which should work in any cases :innocent: )

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.