Tags:
create new tag
, view all tags

Feature Proposal: getEffectiveUser() and getRealUser() in TWiki::Users

Motivation

When user masquerading is in action, you may need to get the effective user and real user.

Description and Documentation

TWiki::Users will have getEffectiveUser($cUID) and getRealUser($cUID) methods, which return the effective and real canonical UIDs respectively while user masquerading is in effect.

Those methods check if the user handler for $cUID has getEffectiveUser() and getRealUser() methods. If those methods exist, they are called and the result is returned. Otherwise, $cUID is returned.

Examples

Let's assume

  • The user mapping handler supports TWikibug:TWiki.UserMasquerading.
  • JaneSmith is masquerading as JoeSchmoe.
    • The current wikiname is JaneSmithOnBehalfOfJoeSchmoe - the user mapping handler is implemented as such
  • DynamicAccessControl is used
    • Topics a user can edit is listed on the Canedit form field of the user's profile topic named Profile%WIKINAME%, e.g. ProfileJaneSmith.

ALLOWWEBCHANGE would be set as follows.

   * Set ALLOWWEBCHANGE = %IF{"%CALCULATE{$SEARCH(\b%TOPIC%\b, %FORMFIELD{"Canedit" topic="Profile%WIKINAME%"}%)"}%" then="%WIKINAME% else="nobody"}%

For the dynamic access control to work even in user masquerading, %WIKINAME% in ALLOWWEBCHANGE needs to be expanded to the effective user's wiki name (JoeSchmoe) instead of the masqueraded identity (JaneSmithOnBehalfOfJoeSchmoe).

For this, there needs to be a way to get the effective user.

Impact

Implementation

-- Contributors: Hideyo Imazu - 2013-03-25

Discussion

This feature is accepted by JerusalemReleaseMeeting2013x03x29

-- Peter Thoeny - 2013-03-29

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2013-09-19 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.