PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TAuthorizationRule

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), a verb (optional), and a list of IP rules (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 ''. Authenticated users are represented by '@'. 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. IP rules are separated by comma ',' and can contain wild card in the rules (e.g. '192.132.23.33, 192.122..*')

TComponent
Extended by TAuthorizationRule
Package: System\Security
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Security/TAuthorizationRule.php
Methods summary
public
# __construct( string $action, string $users, string $roles, string $verb = '', string $ipRules = '' )

Constructor.

Constructor.

Parameters

$action
string
action, either 'deny' or 'allow'
$users
string
a comma separated user list
$roles
string
a comma separated role list
$verb
string
verb, can be empty, 'get', or 'post'
$ipRules
string
IP rules (separated by comma, can contain wild card *)

Overrides

TComponent::__construct()
public string
# getAction( )

Returns

string
action, either 'allow' or 'deny'
public array
# getUsers( )

Returns

array
list of user IDs
public array
# getRoles( )

Returns

array
list of roles
public string
# getVerb( )

Returns

string
verb, may be empty, 'get', or 'post'.
public array
# getIPRules( )

Returns

array
list of IP rules.

Since

3.1.1
public boolean
# getGuestApplied( )

Returns

boolean
if this rule applies to everyone
public boolean
# getEveryoneApplied( )

Returns

boolean
if this rule applies to everyone
public boolean
# getAuthenticatedApplied( )

Returns

boolean
if this rule applies to authenticated users
public integer
# isUserAllowed( IUser $user, string $verb, string $ip )

Parameters

$user
IUser
the user object
$verb
string
the request verb (GET, PUT)
$ip
string
the request IP address

Returns

integer
1 if the user is allowed, -1 if the user is denied, 0 if the rule does not apply to the user
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO