Getting started with WixBuild your website and business with Wix. Try using our AI tools to create your website, customize templates, or hire professionals to build or enhance your online presence.
Creating a websiteRead how to use the Wix Editor and manage content on your site. Discover how to protect your visitors' privacy and make your site accessible.
Account & billingReview your account settings, manage your subscriptions and plans and understand your invoices.
Using the Wix mobile appsUse our mobile apps to run your business efficiently on the go and set up a dedicated app for your site members to stay in touch.
Connecting a domainFollow our step-by step guides to learn how to purchase, connect or transfer a domain for your site, and find out how to keep your site’s data secure.
Managing your businessGet tools to grow your business and web presence. Find the right tools for your specific needs, set up online payments and keep track of your site's analytics.
Promoting your siteLearn to make your site more visible promoting it on search engines, sending emails and running paid ads. Improve your online presence with practical tips.
Studio, Partners & EnterpriseGet the most out of your Studio or Enterprise account with advanced features that'll help you work more efficiently.
Need more help?Find solutions for site performance and technical issues, learn about issues we’re working to fix or contact us for help.
placeholder-preview-image
Wix LearnImprove your skills with our courses and tutorials.
Wix BlogGet tips for web design, marketing and more.
SEO Learning HubLearn to increase organic site traffic from search engines.
Website developmentBuild a custom site using our full-stack platform.
placeholder-preview-image

Velo: About Web Module Permissions

Visit the Velo by Wix website to onboard and continue learning.
Note:
You should have already learned about Web Modules before reading this article.
Web Module permissions allow you to control which users can work with functionality in your site that depends on your Web Module functions. 

Setting Web Module permissions allows you to ensure that no one can access or use your backend code in ways that you didn't intend, either through your site's functionality or using a browser's developer tools.

Web Module permissions example

The following example shows how backend functions with added permissions can only be called by certain types of site visitors.
This example was created using the following code:
1import { helloAnyone, helloMember, helloAdmin } from 'backend/helloModule';
2
3$w.onReady(function () {
4    $w('#anyoneButton').onClick(async () => {
5        try{
6            $w('#responseText').text = await helloAnyone();
7            setupGoodResponse();
8        }
9        catch {
10            $w('#errorText').text = 'Backend call failed. Are you sure you are an anyone?';
11            setupBadResponse();
12        }
13    });
14
15 $w('#memberButton').onClick(async () => {
16        try{
17            $w('#responseText').text = await helloMember();
18            setupGoodResponse();
19        }
20        catch {
21            $w('#errorText').text = 'Backend call failed. Are you logged in?';
22            setupBadResponse();
23        }
24    });
25
26 $w('#adminButton').onClick(async () => {
27        try{
28            $w('#responseText').text = await helloAdmin();
29            setupGoodResponse();
30        }
31        catch {
32            $w('#errorText').text = 'Backend call failed. Are you sure you\'re the admin?';
33            setupBadResponse();
34        }
35    });
36});
37
38function setupGoodResponse() {
39    $w('#errorText').hide();
40    $w('#responseText').show();
41}
42
43function setupBadResponse() {
44    $w('#errorText').show();
45    $w('#responseText').hide();
46}
You can experiment with this example for yourself on our  Hello Web Modules example page.

To set Web Module permissions

  1. Hover over your Web Module, click the settings icon, and select Edit Web Module Permissions.
  2. The Web Module Permissions panel opens, which displays each exported function in your Web Module. Functions that are not exported are not listed.
  1. Click the dropdown next to each function to define its permissions. The choices are:
  • Admin. The administrator of the site.
  • Site member. Anyone who has logged in to the site.
  • Anyone. Anyone visiting the site.
Note:
By default, permissions are granted to Anyone for all the functions in your Web Module.

Helpmate

Hello

Need a bit more guidance?
Unlock personalized helpLog in to get the most out of Helpmate.