{% requirePermission %}

This tag will ensure that the current user is logged in with an account that has a given permission.

{% requirePermission "spendTheNight" %}

<h1>Slumber Party</h1>

The user can have the permission either directly or through one of their user groups. If they don’t have it, a 403 (Forbidden) error will be served.

Available Permissions

The permissions Craft comes with are:

Access the site when the system is offaccessSiteWhenSystemIsOff
Access the CPaccessCp
↳ Access the CP when the system is offaccessCpWhenSystemIsOff
↳ Perform Craft and plugin updatesperformUpdates
↳ Access [Plugin Name]accessPlugin-[PluginHandle]
Edit userseditUsers
↳ Register usersregisterUsers
↳ Assign permissionsassignUserPermissions
↳ Administrate usersadministrateUsers
Delete usersdeleteUsers
Edit [Locale Name]editLocale:[LocaleID]
Edit entrieseditEntries:[SectionID]
↳ Create entriescreateEntries:[SectionID]
↳ Publish entriespublishEntries:[SectionID]
↳ Delete entriesdeleteEntries:[SectionID]
↳ Edit other authors’ entrieseditPeerEntries:[SectionID]
  ↳  Publish other authors’ entries | `publishPeerEntries:[SectionID]`
  ↳  Delete other authors’ entries | `deletePeerEntries:[SectionID]`

↳ Edit other authors’ drafts | editPeerEntryDrafts:[SectionID] ↳ Publish other authors’ drafts | publishPeerEntryDrafts:[SectionID] ↳ Delete other authors’ drafts | deletePeerEntryDrafts:[SectionID] Edit [Global Set Name] | editGlobalSet:[GlobalSetID] Edit [Category Group Name] | editCategories:[CategoryGroupID] View [Asset Source Name] | viewAssetSource:[SourceID] ↳ Upload files | uploadToAssetSource:[SourceID] ↳ Create subfolders | createSubfoldersInAssetSource:[SourceID] ↳ Remove files | removeFromAssetSource:[SourceID]