[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction



August 2010 — updated on : October 2013

All the versions of this article:

This tag was introduced in SPIP 2.0. It is used, within a template, to execute the same checks that would be performed in PHP using the autoriser() function.

It returns a space if the authorisation is granted, and an empty string if it is not. It accepts as many arguments (and the same ones) as are used in the autoriser() function.

For example, to find out if the current visitor has the right to view the statistics for the current article:

   <a href='ecrire/?exec=....'>View the statistics</a>

Just as with the autoriser() function, we can pass an #ID_AUTEUR as an argument to request if that particular author is authorised to do whatever it is.... .

For example, to signal administrators and editors in a list of authors for the site:

   #NOM [(#AUTORISER{ecrire,'','',#ID_AUTEUR}) *]

Another example, shown below, checks if the visitor has modification rights to the article, and if so, to display a form for editing it which will return back to the same article once the changes have been validated:

[(#AUTORISER{modifier, article, #ID_ARTICLE})

Reminder: the arguments for the autoriser function are: (faire, quoi, id, qui, options).

For more details, you are invited to view the full documentation about the functions available in inc/autoriser.php.

Show the template of this page Site powered by SPIP | Translation area | Private area