Child pages
  • Addressing (in code) users "root" and "Guest" using named contants
Skip to end of metadata
Go to start of metadata

Imported from: http://groups.google.com/group/in-portal-dev/browse_thread/thread/82a907b35b0d9285#

System users "root" (id = -1) and "Guest" (id = -2) are using in In-Portal since it's first version. Despite their popularity we always use their IDs in code and not thinking about creating named constants. 

I say enough to mystic numbers and propose to create constants:

  • USER_ROOT - for "-1" value
  • USER_GUEST - for "-2" value

I've already did that and replaced all places, where I've found that magic numbers with proposed constants.

user_constants_modules.patch

user_constants_core.patch

Related Tasks

INP-582 - Getting issue details... STATUS

1 Comment

  1. yes, stop Mystic things is a good idea:-)

    2010/5/18 Alexander Obuhovich <aik.b...@gmail.com>