Working with Dataset Connector Modes and Collection Permissions

When creating a page that lets users interact with content from your collections through a dataset connector, the dataset allows or disallows certain interactions with your collections. There are two independent sets of settings that affect what users can do and who can do it: the dataset mode and the collection permissions.
  • Dataset mode: Defines what actions can be performed on the dataset connector.
  • Collection permissions: Define who can perform certain interactions with the collection.
The access a specific user has to a specific collection through a dataset is ultimately defined by a combination of the dataset mode and the collection permissions. 
Important:
For a deeper understanding of how collection permissions play a part in the security of your site, read this overview.

Dataset modes

A dataset connector connects your site elements to your collections. Setting the Mode for your dataset determines how page elements can interact with your collections. 

Collection permissions

The permissions that you give to a collection determine what it can be used for, since they determine who can view it, submit content to it or modify it. You can only select one permission type per collection.

Example

Let's say we have a collection that holds user comments. We want to allow anyone to read the comments, but only site members can add comments. To do so, we'll use a collection to hold the comments, a form for entering the comments, and a table for displaying the comments. 

We begin by setting our collection permissions to the Member-Generated preset. That preset allows anyone to read the contents of the collection, but only site members can create content, and only site members can update and delete content they themselves created. 

Next we add page elements and define dataset connector mode settings:
  • Page content: Form for entering comments.
  • Dataset mode: Write-only. Restricts what can be done on the page to adding new content.
  • Collection permissions: Restrict who can add the content to users with the Site Member role

  • Page content: Table for displaying comments.
  • Dataset mode: Read-only. Restricts what can be done on the page to reading content.
  • Collection permissions: Doesn't place any restriction on who can read that content, so anyone can.

Note that the collection permissions also allow site members to update or delete the content that they themselves created. However, since we haven't created a page with a dataset that is set to Read & Write mode, there is no way for them to make use of those permissions.

We could change the dataset on the page with the form to Read & Write. We would have to add some functionality to the page, typically in the form of buttons, so that users can click through to reach their own comment, delete a comment, or edit a comment.  

Did this help?

|

Hire a Wix Partner

Get help with your website's design, marketing and small tasks from a professional freelancer or agency.
Start Now