Class WFAuthorizationInfo

Description

The WFAuthorizationInfo object stores all access control information for the logged-in user.

The base class provides the ability to tell if someone is logged in, if they logged in recently, and their userid. For many applications, this is all that's needed.

For applications requiring more complicated access control, they should subclass WFAuthorizationInfo and provide further access control information and methods to query it.

NOTE: The WFAuthorizationInfo class is stored in the SESSION at the time of login. The WFAuthorizationInfo is immutable once stored in the session; whatever rights are given to the user at login remain with him until he logs in again (this includes REMEMBER-ME login). The WFAuthorizationInfo MUST be easily serializable! No circular references, etc... subclasses be careful!

NOTE: If you are using a subclass of WFAuthorizationInfo, please note that the authorizationInfo managed by WFAuthorizationManager will only be of your subclass' type if someone is logged in. Until then, it's always WFAuthorizationInfo. So, always test isLoggedIn() before accessing authorizationInfo as your subclass.

Located in /framework/WFAuthorization.php (line 137)

WFObject
   |
   --WFAuthorizationInfo
Class Constant Summary
 NO_USER = -1
Variable Summary
boolean $isSuperUser
string $userid
Method Summary
WFAuthorizationInfo __construct ()
boolean isLoggedIn ()
boolean isRecentLogin ()
boolean isSuperUser ()
void setIsSuperUser (boolean $isSuperUser)
void setUserid (string $uid)
string userid ()
Variables
boolean $isSuperUser (line 146)
  • var: TRUE is the user is a super-user. FALSE otherwise.
  • access: protected
string $userid (line 142)
  • var: The userid of the logged in user.
  • access: protected
Methods
Constructor __construct (line 153)
WFAuthorizationInfo __construct ()

Redefinition of:
WFObject::__construct()
isLoggedIn (line 193)

Is there a user logged in?

  • return: TRUE if a user is logged in, false otherwise.
boolean isLoggedIn ()
isRecentLogin (line 215)

Has the user authenticated recently?

Some sites may wish to keep a user logged in forever, even with "remember me", but then restrict access to extremely sensitive data by requiring that a user is in a "recent" session. That is, they have recently authenticated with username/password and have not been "idle" in that session for more than a short period of time.

  • return: TRUE if a user has authenticated recently and not been idle for more than WFAuthorizationManager::RECENT_LOGIN_SECS seconds.
boolean isRecentLogin ()
isSuperUser (line 164)

Is the current user a superuser?

  • return: TRUE if superuser, false otherwise.
boolean isSuperUser ()
setIsSuperUser (line 174)

Set the superuser status.

void setIsSuperUser (boolean $isSuperUser)
  • boolean $isSuperUser: TRUE if the user is a superuser, false otherwise.
setUserid (line 183)

Set the user id of the authorized user.

void setUserid (string $uid)
  • string $uid: The user id.
userid (line 203)

What is the userid of the currently logged in user?

  • return: The userid of the currently logged in user, or WFAuthorizationInfo::NO_USER if no one is logged in.
string userid ()

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()
Class Constants
NO_USER = -1 (line 151)

Documentation generated on Thu, 14 May 2009 16:19:46 -0400 by phpDocumentor 1.4.2