Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CAccessControlFilter
  • CAccessRule
  • CAuthAssignment
  • CAuthItem
  • CAuthManager
  • CBaseUserIdentity
  • CDbAuthManager
  • CPhpAuthManager
  • CUserIdentity
  • CWebUser
  • X2WebUser
  • Overview
  • Package
  • Class
  • Tree

Class CAuthItem

CAuthItem represents an authorization item. An authorization item can be an operation, a task or a role. They form an authorization hierarchy. Items on higher levels of the hierarchy inherit the permissions represented by items on lower levels. A user may be assigned one or several authorization items (called CAuthAssignment assignments. He can perform an operation only when it is among his assigned items.

CComponent
Extended by CAuthItem
Package: system\web\auth
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/auth/CAuthItem.php
Methods summary
public
# __construct( IAuthManager $auth, string $name, integer $type, string $description = '', string $bizRule = null, mixed $data = null )

Constructor.

Constructor.

Parameters

$auth
IAuthManager
$auth authorization manager
$name
string
$name authorization item name
$type
integer
$type authorization item type. This can be 0 (operation), 1 (task) or 2 (role).
$description
string
$description the description
$bizRule
string
$bizRule the business rule associated with this item
$data
mixed
$data additional data for this item
public boolean
# checkAccess( string $itemName, array $params = array() )

Checks to see if the specified item is within the hierarchy starting from this item. This method is expected to be internally used by the actual implementations of the IAuthManager::checkAccess().

Checks to see if the specified item is within the hierarchy starting from this item. This method is expected to be internally used by the actual implementations of the IAuthManager::checkAccess().

Parameters

$itemName
string
$itemName the name of the item to be checked
$params
array
$params the parameters to be passed to business rule evaluation

Returns

boolean
whether the specified item is within the hierarchy starting from this item.
public IAuthManager
# getAuthManager( )

Returns

IAuthManager
the authorization manager
public integer
# getType( )

Returns

integer
the authorization item type. This could be 0 (operation), 1 (task) or 2 (role).
public string
# getName( )

Returns

string
the item name
public
# setName( string $value )

Parameters

$value
string
$value the item name
public string
# getDescription( )

Returns

string
the item description
public
# setDescription( string $value )

Parameters

$value
string
$value the item description
public string
# getBizRule( )

Returns

string
the business rule associated with this item
public
# setBizRule( string $value )

Parameters

$value
string
$value the business rule associated with this item
public mixed
# getData( )

Returns

mixed
the additional data associated with this item
public
# setData( mixed $value )

Parameters

$value
mixed
$value the additional data associated with this item
public boolean
# addChild( string $name )

Adds a child item.

Adds a child item.

Parameters

$name
string
$name the name of the child item

Returns

boolean
whether the item is added successfully

Throws

CException
if either parent or child doesn't exist or if a loop has been detected.

See

IAuthManager::addItemChild()
public boolean
# removeChild( string $name )

Removes a child item. Note, the child item is not deleted. Only the parent-child relationship is removed.

Removes a child item. Note, the child item is not deleted. Only the parent-child relationship is removed.

Parameters

$name
string
$name the child item name

Returns

boolean
whether the removal is successful

See

IAuthManager::removeItemChild()
public boolean
# hasChild( string $name )

Returns a value indicating whether a child exists

Returns a value indicating whether a child exists

Parameters

$name
string
$name the child item name

Returns

boolean
whether the child exists

See

IAuthManager::hasItemChild()
public array
# getChildren( )

Returns the children of this item.

Returns the children of this item.

Returns

array
all child items of this item.

See

IAuthManager::getItemChildren()
public CAuthAssignment
# assign( mixed $userId, string $bizRule = null, mixed $data = null )

Assigns this item to a user.

Assigns this item to a user.

Parameters

$userId
mixed
$userId the user ID (see IWebUser::getId())
$bizRule
string
$bizRule the business rule to be executed when CAuthItem::checkAccess() is called for this particular authorization item.
$data
mixed
$data additional data associated with this assignment

Returns

CAuthAssignment
the authorization assignment information.

Throws

CException
if the item has already been assigned to the user

See

IAuthManager::assign()
public boolean
# revoke( mixed $userId )

Revokes an authorization assignment from a user.

Revokes an authorization assignment from a user.

Parameters

$userId
mixed
$userId the user ID (see IWebUser::getId())

Returns

boolean
whether removal is successful

See

IAuthManager::revoke()
public boolean
# isAssigned( mixed $userId )

Returns a value indicating whether this item has been assigned to the user.

Returns a value indicating whether this item has been assigned to the user.

Parameters

$userId
mixed
$userId the user ID (see IWebUser::getId())

Returns

boolean
whether the item has been assigned to the user.

See

IAuthManager::isAssigned()
public CAuthAssignment
# getAssignment( mixed $userId )

Returns the item assignment information.

Returns the item assignment information.

Parameters

$userId
mixed
$userId the user ID (see IWebUser::getId())

Returns

CAuthAssignment
the item assignment information. Null is returned if this item is not assigned to the user.

See

IAuthManager::getAuthAssignment()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
integer TYPE_OPERATION 0
#
integer TYPE_TASK 1
#
integer TYPE_ROLE 2
#
Magic properties summary
public IAuthManager $authManager
#

The authorization manager.

The authorization manager.

public integer $type
#

The authorization item type. This could be 0 (operation), 1 (task) or 2 (role).

The authorization item type. This could be 0 (operation), 1 (task) or 2 (role).

public string $name
#

The item name.

The item name.

public string $description
#

The item description.

The item description.

public string $bizRule
#

The business rule associated with this item.

The business rule associated with this item.

public mixed $data
#

The additional data associated with this item.

The additional data associated with this item.

public array $children
#

All child items of this item.

All child items of this item.

API documentation generated by ApiGen 2.8.0