[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Security/ -> TAuthorizationRule.php (sommaire)

TAuthorizationRule, TAuthorizationRuleCollection class file

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TAuthorizationRule.php 1423 2006-09-16 19:16:14Z xue $
Poids: 221 lignes (6 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

TAuthorizationRule:: (8 méthodes):
  __construct()
  getAction()
  getUsers()
  getRoles()
  getVerb()
  getGuestApplied()
  getEveryoneApplied()
  isUserAllowed()

TAuthorizationRuleCollection:: (2 méthodes):
  isUserAllowed()
  insertAt()


Classe: TAuthorizationRule  - X-Ref

TAuthorizationRule class

TAuthorizationRule represents a single authorization rule.
A rule is specified by an action (required), a list of users (optional),
a list of roles (optional), and a verb (optional).
Action can be either 'allow' or 'deny'.
Guest (anonymous, unauthenticated) users are represented by question mark '?'.
All users (including guest users) are represented by asterisk '*'.
Users/roles are case-insensitive.
Different users/roles are separated by comma ','.
Verb can be either 'get' or 'post'. If it is absent, it means both.

__construct($action,$users,$roles,$verb='')   X-Ref
Constructor.

param: string action, either 'deny' or 'allow'
param: string a comma separated user list
param: string a comma separated role list
param: string verb, can be empty, 'get', or 'post'

getAction()   X-Ref

return: string action, either 'allow' or 'deny'

getUsers()   X-Ref

return: array list of user IDs

getRoles()   X-Ref

return: array list of roles

getVerb()   X-Ref

return: string verb, may be empty, 'get', or 'post'.

getGuestApplied()   X-Ref

return: boolean if this rule applies to everyone

getEveryoneApplied()   X-Ref

return: boolean if this rule applies to everyone

isUserAllowed(IUser $user,$verb)   X-Ref

return: integer 1 if the user is allowed, -1 if the user is denied, 0 if the rule does not apply to the user

Classe: TAuthorizationRuleCollection  - X-Ref

TAuthorizationRuleCollection class.
TAuthorizationRuleCollection represents a collection of authorization rules {@link TAuthorizationRule}.
To check if a user is allowed, call {@link isUserAllowed}.

isUserAllowed($user,$verb)   X-Ref

param: IUser the user to be authorized
param: string verb, can be empty, 'post' or 'get'.
return: boolean whether the user is allowed

insertAt($index,$item)   X-Ref
Inserts an item at the specified position.
This overrides the parent implementation by performing additional
operations for each newly added TAuthorizationRule object.

param: integer the speicified position.
param: mixed new item



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7