Create filter based permissions with Server Layer Views

You can create views of your layers to manage permissions for a subset of records of your layers.

The View feature allows you to manage permissions within your layer, based on the value of a column of your choice. This will filter the data for your users, and they will only see the records they have access to.

For instance, if you want to restrict access geographically, for each Province, all you need to do is add a column in your layer that contains information on the Province. You will then be able to define permissions for the records of each Province.

Another interesting example could be restricting access based on a product line. You can use the column which gives the information of the product line to create your views. Then, set permissions for your co-workers so that everyone can be focused on his or her product of interest.

Create views on the Server

Views are created by separating records based on the value of a column of your choice. 

In the Data tab of the server click on the three dots in the Actions column, then click on Create views:create-views

Select from the list of columns of your layer the one you want to use to generate views:

choose-column-to-create-viewsClick on Create Views.

This will create a view for each value of the column "Province". For instance, the "Ontario" view will contain all records which hold the value "Ontario" for this column.

You can now see in the list view of layers the number of views that have been created for your layer:

number-of-views

Set permissions

Once your views are created, you can click on the number of views to set permissions on these views.

views-and-number-of-records

This list of all the views which have been created in your layer gives you information on the number of records in each view, and the possibility to set permissions for each of these views.

Click on a view to open the information panel, and go to the Permissions tab. Select a user or group from the dropdown, or enter a user or group name.

views-permissions

Each user can have access to several views.

Use a layer with views in the Publisher

If the views and permissions you have set restrict the area of interest of your map depending on the user, you can use the Publisher Map View settings to adapt the map extend for each user.

  1. In your Map Window, click on the Change View button change-view or right click on the map -> Change View.change-view
  2. In the Initial View tab, select Map Layer from the dropdown.
    map-view-settings-map-layer
  3. Select your layer from the list:
    select-layer-initial-map-extend

This will adapt the map extend based on the permissions that have been set. For instance, if you have created views for each Province of Canada, each user will be zoomed in to the Province(s) he has been given access to.

Delete views

To delete views, click on the three dots of the Actions menu, and click on Delete views. This will delete all permissions on these views.

The CartoVista Server REST API can be used to create views and set permissions on views. With the API, views can be created based on an expression, instead of a unique column value. Click here to learn more on the CartoVista Server REST API.