Phundament App Class Reference
  • Package
  • Class
  • Tree

Packages

  • bootstrap
    • widgets
      • input
  • Image
  • None
  • p3admin
  • p3extensions
    • behaviors
    • commands
    • components
    • helpers
    • widgets
  • p3media
    • actions
    • controllers
    • models
  • p3pages
    • models
  • p3widgets
    • components
    • models
  • PHP
  • system
    • db
      • ar
    • gii
    • web
      • auth
      • helpers
      • widgets
  • yiiext
    • widgets
      • fancybox
      • lipsum
  • zii
    • widgets
      • grid

Classes

  • ActivationController
  • AdminController
  • AssignmentController
  • AssignmentForm
  • AuthChildForm
  • AuthItemController
  • AuthItemForm
  • BaseP3Widget
  • BaseP3WidgetMeta
  • BaseP3WidgetTranslation
  • Bootstrap
  • CImageComponent
  • CKEditor
  • CodeProvider
  • DefaultController
  • EChosen
  • EDbMigration
  • EditableField
  • EditableSaver
  • EMigrateCommand
  • ESelect2
  • EUserFlash
  • FullCrudFieldProvider
  • GenerateForm
  • IdentificationColumnValidator
  • InstallController
  • JSONEditorView
  • JuiJSONEditorInput
  • LoginController
  • LogoutController
  • Metadata
  • P3CrudFieldProvider
  • P3MediaController
  • P3MediaMetaController
  • P3MediaSelect
  • P3PageController
  • P3PageMetaController
  • P3PageTranslationController
  • P3Widget
  • P3WidgetController
  • P3WidgetMetaController
  • P3WidgetTranslation
  • P3WidgetTranslationController
  • ProfileController
  • ProfileFieldController
  • RAuthItemBehavior
  • RAuthItemChildDataProvider
  • RAuthItemDataProvider
  • RAuthItemParentDataProvider
  • RAuthorizer
  • RController
  • RDbAuthManager
  • RecoveryController
  • RegistrationController
  • RegistrationForm
  • RGenerator
  • Rights
  • RightsFilter
  • RightsModule
  • RInstaller
  • RPermissionDataProvider
  • RUserBehavior
  • RWebUser
  • UActiveForm
  • UploadHandler
  • UserChangePassword
  • UserController
  • UserIdentity
  • UserLogin
  • UserModule
  • UserRecoveryForm
  • UWdropDownDep
  • UWfile
  • UWjuiAutoComplete
  • UWjuidate
  • UWrelBelongsTo
  • WebUserBehavior

Class Rights

Rights helper class file.

Provides static functions for interaction with Rights from outside of the module.

Copyright: Copyright © 2010 Christoffer Niska
Author: Christoffer Niska <cniska@live.com>
Since: 0.9.1
Located at crisu83/yii-rights/components/Rights.php

Methods summary

public static CAuthItem
# assign( string $itemName, integer $userId, string $bizRule = null, mixed $data = null )

Assigns an authorization item to a specific user.

Assigns an authorization item to a specific user.

Parameters

$itemName
string
$itemName the name of the item to assign.
$userId
integer
$userId the user id of the user for which to assign the item.
$bizRule
string
$bizRule business rule associated with the item. This is a piece of PHP code that will be executed when checkAccess is called for the item.
$data
mixed
$data additional data associated with the item.

Returns

CAuthItem
the authorization item
public static boolean
# revoke( string $itemName, integer $userId )

Revokes an authorization item from a specific user.

Revokes an authorization item from a specific user.

Parameters

$itemName
string
$itemName the name of the item to revoke.
$userId
integer
$userId the user id of the user for which to revoke the item.

Returns

boolean
whether the item was removed.
public static array
# getAssignedRoles( integer $userId = null, boolean $sort = true )

Returns the roles assigned to a specific user. If no user id is provided the logged in user will be used.

Returns the roles assigned to a specific user. If no user id is provided the logged in user will be used.

Parameters

$userId
integer
$userId the user id of the user for which roles to get.
$sort
boolean
$sort whether to sort the items by their weights.

Returns

array
the roles.
public static the
# getBaseUrl( )

Returns the base url to Rights.

Returns the base url to Rights.

Returns

the
url to Rights.
public static array
# getAuthItemOptions( )

Returns the list of authorization item types.

Returns the list of authorization item types.

Returns

array
the list of types.
public static string
# getAuthItemTypeName( integer $type )

Returns the name of a specific authorization item.

Returns the name of a specific authorization item.

Parameters

$type
integer
$type the item type (0: operation, 1: task, 2: role).

Returns

string
the authorization item type name.
public static string
# getAuthItemTypeNamePlural( integer $type )

Returns the name of a specific authorization item in plural.

Returns the name of a specific authorization item in plural.

Parameters

$type
integer
$type the item type (0: operation, 1: task, 2: role).

Returns

string
the authorization item type name.
public static array
# getAuthItemRoute( integer $type )

Returns the route to a specific authorization item list view.

Returns the route to a specific authorization item list view.

Parameters

$type
integer
$type the item type (0: operation, 1: task, 2: role).

Returns

array
the route.
public static array
# getValidChildTypes( string $type )

Returns the valid child item types for a specific type.

Returns the valid child item types for a specific type.

Parameters

$type
string
$type the item type (0: operation, 1: task, 2: role).

Returns

array
the valid types.
public static array
# getAuthItemSelectOptions( mixed $type = null, array $exclude = array() )

Returns the authorization item select options.

Returns the authorization item select options.

Parameters

$type
mixed
$type the item type (0: operation, 1: task, 2: role). Defaults to null, meaning returning all items regardless of their type.
$exclude
array
$exclude the items to be excluded.

Returns

array
the select options.
public static array
# getParentAuthItemSelectOptions( CAuthItem $parent, CAuthItem $type = null, array $exclude = array() )

Returns the valid authorization item select options for a model.

Returns the valid authorization item select options for a model.

Parameters

$parent
mixed
$parent the item type (0: operation, 1: task, 2: role). Defaults to null, meaning returning all items regardless of their type.
$type
CAuthItem
$type the item for which to get the select options.
$exclude
array
$exclude the items to be excluded.

Returns

array
the select options.
protected static array
# generateAuthItemSelectOptions( array $items, mixed $type )

Generates the authorization item select options.

Generates the authorization item select options.

Parameters

$items
array
$items the authorization items.
$type
mixed
$type the item type (0: operation, 1: task, 2: role).

Returns

array
the select options.
public static string
# getDataCsrf( )

Returns the cross-site request forgery parameter to be placed in the data of Ajax-requests. An empty string is returned if csrf-validation is disabled.

Returns the cross-site request forgery parameter to be placed in the data of Ajax-requests. An empty string is returned if csrf-validation is disabled.

Returns

string
the csrf parameter.
public static string
# getCsrfParam( )

Returns the cross-site request forgery parameter for Ajax-requests. Null is returned if csrf-validation is disabled.

Returns the cross-site request forgery parameter for Ajax-requests. Null is returned if csrf-validation is disabled.

Returns

string
the csrf parameter.
public static string
# powered( )

Returns

string
a string that can be displayed on your Web page showing Powered-by-Rights information.
public static RightsModule
# module( )

Returns

RightsModule
the Rights module.
public static RAuthorizer
# getAuthorizer( )

Returns

RAuthorizer
the authorizer component.
public static string
# t( string $category, string $message, array $params = array(), string $source = null, string $language = null )

Translates a message to the specified language. Wrapper class for setting the category correctly.

Translates a message to the specified language. Wrapper class for setting the category correctly.

Parameters

$category
string
$category message category.
$message
string
$message the original message.
$params
array
$params parameters to be applied to the message using <span class="php-keyword2">strtr</span>.
$source
string
$source which message source application component to use.
$language
string
$language the target language.

Returns

string
the translated message.

Magic methods summary

Constants summary

integer PERM_NONE 0
#
integer PERM_DIRECT 1
#
integer PERM_INHERITED 2
#
Phundament App Class Reference API documentation generated by ApiGen 2.8.0