Difference: TWikiFuncDotPm (5 vs. 6)

Revision 603 Mar 2007 - Main.TWikiContributor

Line: 371 to 371
 Since: TWiki::Plugins::VERSION 1.000 (27 Feb 2001)
Changed:
<
<

checkAccessPermission( $type, $wikiName, $text, $topic, $web ) -> $boolean

>
>

checkAccessPermission( $type, $wikiName, $text, $topic, $web, $meta ) -> $boolean

 
Changed:
<
<
Check access permission for a topic based on the TWiki.TWikiAccessControl rules
  • $type - Access type, e.g. 'VIEW', 'CHANGE', 'CREATE'
  • $wikiName - WikiName of remote user, e.g. "PeterThoeny". If $wikiName is '', 0 or undef then access is always permitted.
  • $text - Topic text, optional. If 'perl false' (undef, 0 or ''), topic $web.$topic is consulted
>
>
Check access permission for a topic based on the TWiki.TWikiAccessControl rules
  • $type - Access type, required, e.g. 'VIEW', 'CHANGE'.
  • $wikiName - WikiName of remote user, required, e.g. "PeterThoeny". If $wikiName is '', 0 or undef then access is always permitted.
  • $text - Topic text, optional. If 'perl false' (undef, 0 or ''), topic $web.$topic is consulted. $text may optionally contain embedded %META:PREFERENCE tags. Provide this parameter if:
    1. You are setting different access controls in the text to those defined in the stored topic,
    2. You already have the topic text in hand, and want to help TWiki avoid having to read it again,
    3. You are providing a $meta parameter.
 
  • $topic - Topic name, required, e.g. 'PrivateStuff'
  • $web - Web name, required, e.g. 'Sandbox'
Added:
>
>
  • $meta - Meta-data object, as returned by readTopic. Optional. If undef, but $text is defined, then access controls will be parsed from $text. If defined, then metadata embedded in $text will be ignored. This parameter is always ignored if $text is undefined. Settings in $meta override Set settings in $text.
 A perl true result indicates that access is permitted.
Added:
>
>
Note the wierd parameter order is due to compatibility constraints with earlier TWiki releases.

Tip if you want, you can use this method to check your own access control types. For example, if you:

  • Set ALLOWTOPICSPIN = IncyWincy?
in ThatWeb.ThisTopic, then a call to checkAccessPermissions('SPIN', 'IncyWincy', undef, 'ThisTopic', 'ThatWeb', undef) will return true.
 Since: TWiki::Plugins::VERSION 1.000 (27 Feb 2001)
 
This site is powered by the TWiki collaboration platformCopyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiFuncDotPm