Tags:
create new tag
view all tags

Refactoring Proposal: User Object

The code is currently very confusing in its treatment of users. There is no consistent way to recover user information, and a confusion between login names and wiki names. Also, the checking of permissions is haphazard, is not guaranteed to be consistent, and forces duplication of much code in UI.

This proposal

  • creates a User object for each user in the system.
  • adds a new class Users that takes over the resposibilites of the old User singleton
  • converts all access control checks to use User objects
  • changes access control to use exceptions
  • moves access control checks down into Store

Instead of passing strings login names around, the interface is now to pass user objects around. Each user object may be interrogated to find out the login name, wiki name, and registraion web for the user.

Failed access control checks throw a new exception object, AccessControlException, that is caught in User,pm. This alows:

  1. all scripts to share the same code for redirecting to an "auth" alternative if it exists e.g. viewauth, changesauth, saveauth.
  2. Failures to access topics other than the headline topic to be handled by redirecting to auth
  3. Detailed diagnostic for which topic access failed

The code changes do not imply any functionality changes. Data should be fully compatible with older versions of TWiki.

Committed to DEVELOP branch as rev 3555

-- CrawfordCurrie - 20 Jan 2005

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-01-31 - SamHasler
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.