{% 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’ entriespublishPeerEntries:[SectionID]
      ↳  Delete other authors’ entriesdeletePeerEntries:[SectionID]
↳  Edit other authors’ draftseditPeerEntryDrafts:[SectionID]
      ↳  Publish other authors’ draftspublishPeerEntryDrafts:[SectionID]
      ↳  Delete other authors’ draftsdeletePeerEntryDrafts:[SectionID]
Edit [Global Set Name]editGlobalSet:[GlobalSetID]
Edit [Category Group Name]editCategories:[CategoryGroupID]
View [Asset Source Name]viewAssetSource:[SourceID]
↳  Upload filesuploadToAssetSource:[SourceID]
↳  Create subfolderscreateSubfoldersInAssetSource:[SourceID]
↳  Remove filesremoveFromAssetSource:[SourceID]