Table Level Sharing

Hi Ya’ll. Is there a way to share an individual table with permissions similar to how we can share a document?

Hi Chris!

You can use Access Rules to limit table sharing. Let’s say you want specific users to only see one table in your document. You can block them from all other tables then give either view or edit permissions in the one table they have access to. You can also limit access to columns or rows.

Anais did a webinar on Access Rules. The link below starts at the Table Rules section of the webinar.

1 Like

Hi @natalie-grist ! Thanks for your response. My usecase was that I wanted to share different tables in the same document as public links so that they can be edited without the visitor having to create an account since they will just be working on that one table.

I do not want any of the other tables, (there’s 7 of them) viewable by any one user.

So Each user works on one table, can’t see any other tables, does not need to create account. Is there a way to achieve this with access rules, I tried but it seemed that at that granular of a level, that the user email needs to be used as authentication.

If table level sharing was allowed, this would not be the case.

Am I missing something?

The ‘magic formula’ to achieve this exact result would be ‘Link Keys’, which can be combined with Access Rules, in particular, using a User Attribute table you can add attributes to the ‘user’ based on a LinkKey variable:
https://support.getgrist.com/access-rules/#link-keys
https://support.getgrist.com/access-rules/#user-attribute-tables

2 Likes

Hi Chris,

I created an example for you at the link below:
https://public.getgrist.com/hkVVXXZSaNtt/Community-1081/p/1?UUID_=df79c485-9464-4ddd-9d7e-5a3783137b79

With that link, you will be able to view and edit the entire document.

First, you will need to create a unique identifier for each table and we’ll keep this information in a user attributes table. For each table we’ll need a UUID(), as explained in the Link Keys article.

Add a column with the formula UUID().

image

This generates a unique ID for each table. We don’t want this ID to change so under Column Behavior, choose the option to ‘Convert column to data’.

This converts the formula to a trigger formula. Set this to apply to new records.

If you add a new record here, a new UUID will be generated.

Now we’ll need to create a unique link for each table. Add another column with the following formula:

SELF_HYPERLINK(LinkKey_UUID=$UUID_COLUMN_NAME)

If you’d like the link to just show as a label, use the following formula:

SELF_HYPERLINK(label=$COLUMN_NAME, LinkKey_UUID=$UUID_COLUMN_NAME)

Be sure to change the Cell Format to Hyperlink.

Next, we can set up Access Rules for each UUID.

Add table rules for each table. The two conditions you will need are:

user.Access == OWNER
user.LinkKey.UUID =="[INSERT TABLE-SPECIFIC UUID]"

Allow all permissions for the two conditions. Add a final condition for Everyone Else and deny all.

I have a third condition with the UUID beginning in df79c. This was specifically to grant you full access to the document. For your own document, anyone who needs full access can be added as an OWNER.

You will also need to restrict access to any other tables in the document. In our example, we’ll need to restrict access to ‘User Attributes’ table. Only owner should have access to this table.

You’ll also want to add a column rule for the UUID column. Make this read only for OWNER. This way, no one could accidentally change a UUID leading to someone losing access to their table.

Again, I have an extra condition here for UUID = df79c... in order to grant you access to the entire document.

To see this version of access rules, check out this link: Community 1081 - Access Rules V1

Note that you could also create a user attribute in Access Rules to represent the UUID. Then, your conditions could use a value in the user attributes table. In the screenshot below, I specify a value from the Table column to grant permissions, using the user attribute I created for UUID.

To see this version of access rules, check out this link: Community 1081 - Access Rules V2

Now user access is restricted based on URL!
Table 1 Access
Table 2 Access
Table 3 Access
Full Access

Let me know if you have any questions.

Thanks,
Natalie

2 Likes

@natalie-grist I think this is exactly what I wanted!!! Thanks. I’m going to set this up and will let you know if I have any issues! Thanks again!!

1 Like