PHP Класс Scalr_UI_Request

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$requestApiVersion

Защищенные свойства (Protected)

Свойство Тип Описание
$aclRoles Scalr\Acl\Role\AccountRoleSuperposition Acl roles for this user and environment
$clientIp
$definitions
$environment
$paramErrors
$params
$paramsIsValid
$requestFiles
$requestHeaders
$requestParams
$requestServer
$requestType
$scope
$user Scalr_Account_User

Открытые методы

Метод Описание
__construct ( $type, $headers, $server, $params, $files )
addValidationErrors ( $field, $errors )
checkPermissions ( object $object, boolean | string $modify = null ) Check whether the user has access permissions to the specified object
defineParams ( $defs )
getAclRoles ( ) : Scalr\Acl\Role\AccountRoleSuperposition Gets acl roles superposition for the request
getAuditLoggerConfig ( )
getClientIp ( ) Gets client ip address for the current request
getClientIpAddress ( ) : string Gets client ip address
getCloudResourceFilteringDecision ( integer $resourceId, string $platform = SERVER_PLATFORMS::EC2, string $farmId = null ) : Scalr\Acl\Resource\CloudResourceFilteringDecision Gets Cloud Resource filtering decision for the specified ACL resource
getEnvironment ( ) : Scalr_Environment Gets an environment instance which is associated with the request
getFarmSqlQuery ( string $permissionId = null ) : string Generate conditions for sql query to limit access by only allowable farms.
getFileName ( $name )
getHeaderVar ( $name )
getInstance ( ) : Scalr_UI_Request
getParam ( $key, boolean $rawValue = false ) : mixed
getParams ( )
getRemoteAddr ( ) : string Gets User's IP
getRequestParam ( $key )
getRequestType ( )
getScope ( )
getUser ( ) : Scalr_Account_User
getValidationErrors ( )
getValidationErrorsMessage ( )
hasParam ( $key )
hasPermissions ( object $object, boolean | string $modify = null ) : boolean Check whether the user has access permissions to the specified object
initializeInstance ( $type, $headers, $server, $params, $files, $userId, $envId = null ) : Scalr_UI_Request
isAllowed ( integer | string | array $resourceId, string $permissionId = null ) : boolean Checks if access to ACL resource or unique permission is allowed
isFarmDesignerAllowed ( ) : boolean Checks whether user has access to FarmDesigner
isInterfaceBeta ( )
isInterfaceBetaOrNotHostedScalr ( ) : boolean Checks whether either it is beta version of interface or not hosted scalr install
isValid ( )
restrictAccess ( $resourceId, $permissionId = null )
restrictFarmDesignerAccess ( ) Checks whether user has access to FarmDesigner
setParam ( $key, $value )
setParams ( $params )
stripValue ( $value ) : string clear string from prohibited symbols
validate ( ) : Scalr_UI_Request

Описание методов

__construct() публичный Метод

public __construct ( $type, $headers, $server, $params, $files )

addValidationErrors() публичный Метод

public addValidationErrors ( $field, $errors )
$field string
$errors array|string

checkPermissions() публичный Метод

Check whether the user has access permissions to the specified object
public checkPermissions ( object $object, boolean | string $modify = null )
$object object
$modify boolean | string

defineParams() публичный Метод

public defineParams ( $defs )

getAclRoles() публичный Метод

Gets acl roles superposition for the request
public getAclRoles ( ) : Scalr\Acl\Role\AccountRoleSuperposition
Результат Scalr\Acl\Role\AccountRoleSuperposition

getAuditLoggerConfig() публичный Метод

См. также: Scalr\LogCollector\AuditLoggerRetrieveConfigurationInterface::getAuditLoggerConfig()

getClientIp() публичный Метод

Gets client ip address for the current request
public getClientIp ( )

getClientIpAddress() публичный статический Метод

Gets client ip address
public static getClientIpAddress ( ) : string
Результат string Returns client ip address.

getCloudResourceFilteringDecision() публичный Метод

Gets Cloud Resource filtering decision for the specified ACL resource
public getCloudResourceFilteringDecision ( integer $resourceId, string $platform = SERVER_PLATFORMS::EC2, string $farmId = null ) : Scalr\Acl\Resource\CloudResourceFilteringDecision
$resourceId integer ACL Resource ID which should have defined Mode which is the instance of CloudResourceScopeMode
$platform string optional The Cloud Platform TODO It isn't supported yet
$farmId string optional The Farm identifier
Результат Scalr\Acl\Resource\CloudResourceFilteringDecision Returns decision object

getEnvironment() публичный Метод

Gets an environment instance which is associated with the request
public getEnvironment ( ) : Scalr_Environment
Результат Scalr_Environment

getFarmSqlQuery() публичный Метод

Table farms should have alias f.
public getFarmSqlQuery ( string $permissionId = null ) : string
$permissionId string optional
Результат string

getFileName() публичный Метод

public getFileName ( $name )

getHeaderVar() публичный Метод

public getHeaderVar ( $name )

getInstance() публичный статический Метод

public static getInstance ( ) : Scalr_UI_Request
Результат Scalr_UI_Request

getParam() публичный Метод

Устаревший: all parameters should be defined in function's arguments
public getParam ( $key, boolean $rawValue = false ) : mixed
$key
$rawValue boolean if true returns rawValue (not stripped) only once, don't save in cache
Результат mixed

getParams() публичный Метод

public getParams ( )

getRemoteAddr() публичный Метод

Gets User's IP
public getRemoteAddr ( ) : string
Результат string Returns User's IP

getRequestParam() публичный Метод

public getRequestParam ( $key )

getRequestType() публичный Метод

public getRequestType ( )

getScope() публичный Метод

public getScope ( )

getUser() публичный Метод

public getUser ( ) : Scalr_Account_User
Результат Scalr_Account_User

getValidationErrors() публичный Метод

public getValidationErrors ( )

getValidationErrorsMessage() публичный Метод

hasParam() публичный Метод

public hasParam ( $key )

hasPermissions() публичный Метод

Check whether the user has access permissions to the specified object
public hasPermissions ( object $object, boolean | string $modify = null ) : boolean
$object object
$modify boolean | string
Результат boolean Returns TRUE if the authenticated user has access or FALSE otherwise

initializeInstance() публичный статический Метод

public static initializeInstance ( $type, $headers, $server, $params, $files, $userId, $envId = null ) : Scalr_UI_Request
$type
$headers
$server
$params
$files
$userId
$envId int optional Could be null, when we check headers (for UI)
Результат Scalr_UI_Request

isAllowed() публичный Метод

Usage: -- use \Scalr\Acl\Acl; The ID of the ACL resource; The ID of the unique permission which is related to specified resource $this->request->isAllowed(Acl::RESOURCE_FARMS, Acl::PERM_FARMS_EDIT); Array of IDs of the ACL resource (check if user have any permission); The ID of the unique permission which is related to specified resource $this->request->isAllowed([Acl::RESOURCE_FARMS, Acl::RESOURCE_OWN_FARMS], Acl::PERM_FARMS_EDIT); Mnemonic constants: resource, permission Method interprets $resourceMnemonic as RESOURCE_$resourceMnemonic_$scope, $permissionMnemonic as PERM_$resourceMnemonic_$scope_$permissionMnemonic For example, call(ROLES, MANAGE) on account scope will check RESOURCE_ROLES_ACCOUNT, PERM_ROLES_ACCOUNT_MANAGE $this->request->isAllowed('ROLES', 'MANAGE');
public isAllowed ( integer | string | array $resourceId, string $permissionId = null ) : boolean
$resourceId integer | string | array The ID or Name of the ACL resource or array of resources
$permissionId string optional The ID or Name of the unique permission which is related to specified resource.
Результат boolean Returns TRUE if access is allowed

isFarmDesignerAllowed() публичный Метод

Checks whether user has access to FarmDesigner
public isFarmDesignerAllowed ( ) : boolean
Результат boolean

isInterfaceBeta() публичный Метод

public isInterfaceBeta ( )

isInterfaceBetaOrNotHostedScalr() публичный Метод

Checks whether either it is beta version of interface or not hosted scalr install
public isInterfaceBetaOrNotHostedScalr ( ) : boolean
Результат boolean Returns true if it is either a beta version of interface or it isn't hosted scalr install

isValid() публичный Метод

public isValid ( )

restrictAccess() публичный Метод

См. также: Scalr_UI_Controller_Request::isAllowed
public restrictAccess ( $resourceId, $permissionId = null )

restrictFarmDesignerAccess() публичный Метод

Checks whether user has access to FarmDesigner

setParam() публичный Метод

public setParam ( $key, $value )

setParams() публичный Метод

public setParams ( $params )

stripValue() публичный Метод

clear string from prohibited symbols
public stripValue ( $value ) : string
$value string
Результат string

validate() публичный Метод

public validate ( ) : Scalr_UI_Request
Результат Scalr_UI_Request

Описание свойств

$aclRoles защищенное свойство

Acl roles for this user and environment
protected AccountRoleSuperposition,Scalr\Acl\Role $aclRoles
Результат Scalr\Acl\Role\AccountRoleSuperposition

$clientIp защищенное свойство

protected $clientIp

$definitions защищенное свойство

protected $definitions

$environment защищенное свойство

protected $environment

$paramErrors защищенное свойство

protected $paramErrors

$params защищенное свойство

protected $params

$paramsIsValid защищенное свойство

protected $paramsIsValid

$requestApiVersion публичное свойство

public $requestApiVersion

$requestFiles защищенное свойство

protected $requestFiles

$requestHeaders защищенное свойство

protected $requestHeaders

$requestParams защищенное свойство

protected $requestParams

$requestServer защищенное свойство

protected $requestServer

$requestType защищенное свойство

protected $requestType

$scope защищенное свойство

protected $scope

$user защищенное свойство

protected Scalr_Account_User $user
Результат Scalr_Account_User