{% unset_client_permission %}

Removes the specified permissions from the permissions cookie. Note that this is not the same as denying permission since there will be no record that permission was either granted or denied after the permission has been unset.

Syntax

{% unset_client_permission [name1] [name2] [etc...] %}

You may also include reference variables as properties, which will be dereferenced to their permission names before they are unset.

If no permissions are specified, this will clear ALL permissions. Note that this INCLUDES the session permission, which will result in the session being denied for the remainder of the request, regardless of the default session value in the site settings.

Examples

Unset Client Permissions

Copy
{% if request.query_params.user_confirmation != permissions.external_user.value %} {% unset_client_permissions external_user %}

Some error message about failed confirmation and please try again

{% endif %}

Unset Client Permissions by reference

Copy
{% var unset_parties = request.query_params.third_party_unknowns | split: ',' %} {% for party in unset_parties %} {% unset_client_permissions &party %} {% endfor %}

Safely Unset Client Permissions

Copy
{% if unsafely_nuke_the_permissions %} {% unset_client_permissions %} {% elsif safely_nuke_the_permissions %} {% var oldSession = session.allowed %} {% unset_client_permissions %} {% if oldSession %} {% set_client_permissions allow session %} {% endif %} {% endif %}