Software Design – Naming Different User Roles

namingprogramming practicesusers

I'm just curious, I'm building a web app with a User model which has role-based permissions.

I have the following roles:

  • Visitor (anonymous user)
  • ?? (logged-in user)
  • Moderator
  • Admin

I'm having a hard time figuring out what to call a logged-in user. I want to just call them "users", but I find that having a role with the same name as the class creates confusing code sometimes. For instance: if user.user? then...

If you've built software with roles for users, what do you call the basic, registered, no special permissions, user role?

EDIT: As a side consideration, this app has Subscribers and Non Subscribers. Whether or not a user is a subscriber is not the same as their role, but it affects the way I've been thinking about this. For instance, calling a regular user a "member" sounds a lot like what I would call a subscriber, so I haven't been too fond of that. I haven't ruled it out though.

Best Answer

All the following are conceptually opposite of Anonymous, I address your use of the name Visitor as related to the definition of Anonymous below.

Authenticated User - your use of logged in in implies supplying some sort of credentials.

Identified User - implies you know who there are based on the login information.

Verified User - implies some checking of credentials and known information.

Known User - a direct Antonym of Anonymous.

Other possibilities are the opposite of Anonymous, the thesaurus is a good place to start looking for names, they usually provide great semantically more relevant synonyms, but also a good choice of antonyms.

Also it is implied that Moderator and Admin are logged in, and technically sub-roles of your logged in state user.

NOTE: The Antonym of Visitor is Host.

The definition of Visitor is person temporarily in a foreign location, it doesn't imply that they are Anonymous which is unknown, usually by choice

So it isn't semantically a Synonym for Anonymous user.

english.stackexchanged.com is a good place to ask this type of advice as well.

Related Topic