Class Gate

Description

Access Control Mechanism.

CompInaBox uses a Gate/Guard metaphor for access control. A given page will configure a Gate with a list of "locks". A user must be able to unlock at least one of the locks on the Gate to Proceed.

  • internal: Notes: All member functions require the class to be instantiated, no static functions are provided, the instantiation requirement is not explicitly mentioned in the function descriptions. Locks are currently identical to keys, in the future it is expected that Locks will be a subset of Keys, as keys evolve into an accountable token that may be shared between servers.
  • access: public

Located in /include/classes/access-control/Gate.inc (line 33)


	
			
Variable Summary
 boolean $_isLocked
 boolean $_isOpen
 array $_locks
Method Summary
 Gate Gate ()
 boolean isLocked ()
 boolean isOpen ()
 void lockGate ([array $keys = array(array("Type"=>"Site","Level"=>"Admin"))])
 void lowerPortcullis ()
 void raisePortcullis ()
 void unlockGate (array $presentedKeys)
 void _testCompKey (mixed $trialKey, array $trialLey)
 void _testSiteKey (mixed $trialKey, array $trialLey)
 void _testTeamKey (mixed $trialKey, array $trialLey)
Variables
boolean $_isLocked (line 46)

a locked gate requires comparison of user's authorization

  • access: private
boolean $_isOpen (line 40)

a closed gate requires Authentication to proceed

  • access: private
array $_locks (line 52)

A list of credentials that can unlock the Gate

  • access: private
Methods
Constructor Gate (line 60)

Gate Constructor.

Creates an open and unlocked gate. Such a Gate doesn't require either authentication nor authorization.

  • access: public
Gate Gate ()
isLocked (line 82)

Tests whether a gate is locked or not.

  • return: true if the gate is locked, false otherwise
  • access: public
boolean isLocked ()
isOpen (line 72)

Tests whether a gate is open or not.

  • return: true if the gate is open, false otherwise
  • access: public
boolean isOpen ()
lockGate (line 124)

Locks a Gate.

This function establishes the credentials needed to unlock the gate. It will close the gate if needed, before locking. A use must match at least one of the listed credentials to be allowed access

  • internal: If no key of type "Site" is given, the Site Admin key is automatically added.
  • access: public
void lockGate ([array $keys = array(array("Type"=>"Site","Level"=>"Admin"))])
  • array $keys: a list of credentials, defaults to site admin only
lowerPortcullis (line 94)

Close the Gate.

This function closes, but does not lock the gate. A closed gate is openable by any authenticated user regardless of tokens (but will keep out non-logged in users).

  • access: public
void lowerPortcullis ()
raisePortcullis (line 107)

Opens an unlocked Gate.

This function opens an unlocked gate. No action is taken on a locked gate.

  • internal: as a gate begins open, this function is used to signal that the required authoization has been met
  • access: public
void raisePortcullis ()
unlockGate (line 185)

Attempts to unlock a Gate.

Attempts to unlock the gate using the keys provided, should a match occur the gate is unlocked and the portcullis raised.

  • internal: As the gate is raised in sucess the caller should call isOpen to test for success. Leaving the gate open after a successful authorization is not an issue as each gate exists for one attempt only.
  • access: public
void unlockGate (array $presentedKeys)
  • array $presentedKeys: a list of credentials
_testCompKey (line 266)

Test comp keys on a Gate's locks.

Cycles through a Gate's lock, testing the presented key against each

  • internal:

    The family of test{Site/Comp/Team}Key are all very similar but were broken up to avoid requiring either messy logic or database queries.

    This function holds the hierarchial data for which comp levels supersede others. Current hierachy is

    Staff < [Comptroller | Registrar] < Coordinator

  • access: private
void _testCompKey (mixed $trialKey, array $trialLey)
  • array $trialLey: a key to test
_testSiteKey (line 229)

Test site keys on a Gate's locks.

Cycles through a Gate's lock, testing the presented key against each

  • internal:

    The family of test{Site/Comp/Team}Key are all very similar but were broken up to avoid requiring either messy logic or database queries.

    This function holds the hierarchial data for which site levels supersede others. Current hierarchy is

    Staff < Admin

  • access: private
void _testSiteKey (mixed $trialKey, array $trialLey)
  • array $trialLey: a key to test
_testTeamKey (line 318)

Test team keys on a Gate's locks.

Cycles through a Gate's lock, testing the presented key against each

  • internal:

    The family of test{Site/Comp/Team}Key are all very similar but were broken up to avoid requiring either messy logic or database queries.

    This function holds the hierarchial data for which team levels supersede others. Current hierarchy is

    Member < [Treasurer | Registration Coordinator] < Captain

  • access: private
void _testTeamKey (mixed $trialKey, array $trialLey)
  • array $trialLey: a key to test

Documentation generated on Tue, 25 Apr 2006 13:01:37 -0400 by phpDocumentor 1.3.0RC3