Manual:Hooks/userCan

$title

 * reference to the title in question (see the use in $IP/includes/Title.php)

$user

 * reference to the current user (see the use in $IP/includes/Title.php)

$action

 * action (string) concerning the title in question

$result

 * reference to the result propagated along the chain of hooks (see $IP/includes/Hooks.php)
 * $result can be left untouched, or set to   or  , according to the opinion of the particular hook function
 * true means that the user is allowed, and false means that the $user is disallowed for the $action concerning the <tvar|3>$title</>
 * leaving untouched means that the hook function has no opinion about the situation

return value of the hook function

 * the individual hook functions of the possibly nested list of hooks are processed in order of their natural occurrence, from the beginning until either the end of the list is reached, or the current hook function doesn't return <tvar|1> </>
 * a particular hook function on the list will stop the processing, if it returns <tvar|1> </>.

intentional side effect of the chain of hook function

 * <tvar|1>$result</> given by reference to each hook function contains the resulting opinion of the hook functions processed so far
 * to be the first in the list of hooks has the disadvantage, that later hook functions have the opportunity to change the <tvar|1>$result</>
 * to be the last in the list of hooks has the disadvantage, that the processing of the hooks will simply not reach that point, hence less chance to have an impact on the <tvar|1>$result</>

The final decision concerning the <tvar|1>$title - $user - $action</> triple is the value can be found in <tvar|2>$result</>, when the processing of the list of hooks is finished.