PHP Class Scalr_Permissions

Mostra file Open project: scalr/scalr

Protected Properties

Property Type Description
$envId
$user

Public Methods

Method Description
__construct ( Scalr_Account_User $user )
check ( $object )
hasAccessEnvironment ( integer $envId ) : boolean Checks whether specified environment corresponds the user's environment.
hasAccessFarm ( DBFarm $dbFarm, string $perm = null ) : boolean Checks whether current dbFarm object can be accessed by user
hasAccessServer ( DBServer $dbServer ) : boolean Checks whether specified server can be accessed by the user
hasReadOnlyAccessServer ( DBServer $dbServer ) : boolean Checks whether user read only access to specified server
setEnvironmentId ( integer $envId ) : Scalr_Permissions Sets Environment Id
validate ( $object )

Method Details

__construct() public method

public __construct ( Scalr_Account_User $user )
$user Scalr_Account_User

check() public method

public check ( $object )

hasAccessEnvironment() public method

Checks whether specified environment corresponds the user's environment.
public hasAccessEnvironment ( integer $envId ) : boolean
$envId integer The ID of the environment
return boolean Returns true if user's environment equals to specified environment

hasAccessFarm() public method

Checks whether current dbFarm object can be accessed by user
public hasAccessFarm ( DBFarm $dbFarm, string $perm = null ) : boolean
$dbFarm DBFarm DbFarm object
$perm string
return boolean Returns true if access is granted

hasAccessServer() public method

Checks whether specified server can be accessed by the user
public hasAccessServer ( DBServer $dbServer ) : boolean
$dbServer DBServer The DBServer object
return boolean Returns true if specified server can be accessed by the user

hasReadOnlyAccessServer() public method

Checks whether user read only access to specified server
public hasReadOnlyAccessServer ( DBServer $dbServer ) : boolean
$dbServer DBServer The DBServer object
return boolean Returns true if specified server can be accessed by the user

setEnvironmentId() public method

Sets Environment Id
public setEnvironmentId ( integer $envId ) : Scalr_Permissions
$envId integer
return Scalr_Permissions

validate() public method

public validate ( $object )

Property Details

$envId protected_oe property

protected $envId

$user protected_oe property

protected $user