Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Learn to set the permissions for your modules to keep information protected.
There are 3 Available Permissions for the Contact Module
- Administer contact forms and contact form settings
- Use the site-wide contact form
- Use users' personal contact forms
Most modules come with a set of their own permissions because they create new functionality that you may or may not want all users to have access to.
Who Should Get Which Permissions?
We only want users with the Administrator Role to be able to change the way the contact form is set up, so we would assign the first Permission only to the Administrator role. But we might want anyone to be able to use the site-wide contact form, so we could assign that Permission to the Anonymous user role.
To work with permissions for your site and all of its modules, visit the Permissions Administration page by clicking on "People" in the Management menu, and then select the "Permissions" tab in the top right corner.
-
0:00
Remember our discussion of user roles?
-
0:02
You're currently signed in with the role of administrator.
-
0:06
And the administrator has permission to access anything on the website.
-
0:11
Let's test our new contact form as if we had the role of anonymous user,
-
0:16
which means anyone who's visiting your site without being logged in.
-
0:20
To do this, we can either sign out of the website or
-
0:25
we can open a new incognito browser window in Chrome.
-
0:30
Let's go to local host:8888 again.
-
0:34
Wait, where did the context tab go?
-
0:37
Well, if we log back in with your admin account, then it will come back.
-
0:46
This is happening,
-
0:47
because you have not given anonymous users permission to use the contact form.
-
0:52
Most modules come with their own permissions, because modules create new
-
0:56
functionality that you may or may not want all users to have access to.
-
1:02
Permissions are then assigned to user roles, administrator, authenticated,
-
1:07
or anonymous.
-
1:09
Remember that we can edit the permissions for
-
1:11
each user role in the global permission page.
-
1:14
We can also return to the module administration page and
-
1:18
click on the permissions link.
-
1:21
In the Contact module row under OPERATIONS.
-
1:27
This takes you to the Contact module section of the permissions page.
-
1:33
Remember, you can also get to this page to edit other module permissions
-
1:39
by clicking on People in the management menu.
-
1:42
And then selecting the PERMISSIONS tab.
-
1:45
This is the same page that we were on.
-
1:48
Under Contact in the left column,
-
1:50
you can see that there are three available permissions.
-
1:54
Administer contact forms and contact form settings,
-
1:58
Use the site-wide contact form, and Use user's personal contact forms.
-
2:06
Each can be assigned to any, all, or none
-
2:10
of the user roles using the check boxes on the right, just like any other permission.
-
2:15
Remember, an ANONYMOUS USER is anyone who has logged out.
-
2:20
An AUTHENTICATED USER is anyone who is logged in.
-
2:24
The MODERATOR role is the one we created for Cameron earlier, and
-
2:29
an ADMINISTRATOR is only you and anyone else you assign this role to.
-
2:34
The administrator is the only one who has access to the first permission right now,
-
2:40
which makes sense.
-
2:41
You wouldn't want just any old user to be able to edit the actual contact form and
-
2:46
change its settings.
-
2:47
We just want users to be able to fill them in.
-
2:50
The second permission, allowing a user to actually send us the contact form,
-
2:56
should be assigned to ANONYMOUS and AUTHENTICATED users.
-
3:00
Because Cameron wants all his users to be able to contact him.
-
3:04
So check both of these boxes.
-
3:07
The third permission allows direct contact between users
-
3:11
instead of just from users to Cameron.
-
3:14
Cameron just wants users to be able to contact him.
-
3:18
So we can leave these as they are.
-
3:20
Make sure to click Save at the bottom of the page.
-
3:26
And now if we open a new incognito window or click on log out in our user menu,
-
3:32
we can see that we can use the contact from even as an anonymous user.
You need to sign up for Treehouse in order to download course files.
Sign up