**SPIP**
# Article submitted
The article "**|sinon\_interdire\_acces**
(https://www.spip.net/ecrire/?exec=article&id_article=6612)" is submitted
for publication. on Sunday 4 October 2020.
* * *
## |sinon\_interdire\_acces
Sunday 4 October 2020 , by [jack](.././?page=auteur&id_auteur=593&)
## Table of contents
* See also
The filter `|sinon_interdire_acces` allows to redirect to an error page if
it is applied to a variable equal to `false`. This filter is often applied
to the result of a `#AUTORISER` [1] , it can be inserted anywhere in the
template, even in inclusions.
The following code will redirect to a standard error page (by default on a
403 in the private area and 404 in the public area) if the user does not
have webmaster rights.
1. [ ( #AUTORISER {webmestre} |sinon\_interdire\_acces ) ]
Instead of simply redirecting the user to a standard error page, you can
fill in a redirection URL as the first parameter, and specify the error
code as the second parameter.
The following example checks the authorization "*ecrire*", which tests
whether the internaut is connected and has the right to access SPIP’s
private area (i.e. at least an editor or administrator status). If not, he
will be redirected to the login page.
[
(
#AUTORISER
{ecrire}
|sinon_interdire_acces
{
#URL_PAGE
{login}, 401}
)
]
## See also [|Back to the table of contents](#s-See-also)
**Other test filters**
* |oui (https://www.spip.net/ecrire/?exec=article&id_article=4984)
* |non (https://www.spip.net/ecrire/?exec=article&id_article=4985)
* |?*ifyes, ifnot*
(https://www.spip.net/ecrire/?exec=article&id_article=5024)
* |sinon (https://www.spip.net/ecrire/?exec=article&id_article=4966)
**les filtres logiques **
* |et (https://www.spip.net/ecrire/?exec=article&id_article=4953)
* |ou (https://www.spip.net/ecrire/?exec=article&id_article=4952)
* |xou (https://www.spip.net/ecrire/?exec=article&id_article=4951)
[1] See the description of the tag #AUTORISER
(https://www.spip.net/ecrire/?exec=article&id_article=5103) and the
corresponding API
(https://www.spip.net/ecrire/?exec=article&id_article=6599).
— Sent by SPIP (https://www.spip.net/)
![]()