PHP 클래스 Scalr_UI_Request

파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$requestApiVersion

보호된 프로퍼티들

프로퍼티 타입 설명
$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