PHP Class Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl

Since: 5.11 (08.01.2016)
Author: Andrii Penchuk ([email protected])
Inheritance: extends Scalr\Acl\Acl
显示文件 Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$aclType string Acl type for test

Protected Properties

Property Type Description
$accountRoleId string Auto-generated ID for account role usage

Public Methods

Method Description
__construct ( ) ApiTestAcl constructor. Generate base accountRoleId
createTestAccountRole ( integer $accountId, string $name, integer $roleId ) Create test account role
deleteTestAccountRole ( integer $accountId, string $name ) Delete test Account Role
getUserRoles ( integer | User $user ) : Scalr\Acl\Role\AccountRoleSuperposition Gets user roles by default base role (full or readOnly access)
getUserRolesByEnvironment ( integer | User $user, integer $envId, integer $accountId ) : Scalr\Acl\Role\AccountRoleSuperposition Gets account roles by default base role (full or readOnly access)

Method Details

__construct() public method

ApiTestAcl constructor. Generate base accountRoleId
public __construct ( )

createTestAccountRole() public method

Create test account role
public createTestAccountRole ( integer $accountId, string $name, integer $roleId )
$accountId integer The identifier of the client's account
$name string Role name
$roleId integer Default Acl role identifier

deleteTestAccountRole() public method

Delete test Account Role
public deleteTestAccountRole ( integer $accountId, string $name )
$accountId integer The identifier of the client's account
$name string Role name

getUserRoles() public method

Gets user roles by default base role (full or readOnly access)
public getUserRoles ( integer | User $user ) : Scalr\Acl\Role\AccountRoleSuperposition
$user integer | Scalr\Model\Entity\Account\User User identifier or user object
return Scalr\Acl\Role\AccountRoleSuperposition

getUserRolesByEnvironment() public method

Gets account roles by default base role (full or readOnly access)
public getUserRolesByEnvironment ( integer | User $user, integer $envId, integer $accountId ) : Scalr\Acl\Role\AccountRoleSuperposition
$user integer | Scalr\Model\Entity\Account\User User identifier or user object
$envId integer Environment identifier
$accountId integer Identifier of the client's account
return Scalr\Acl\Role\AccountRoleSuperposition

Property Details

$accountRoleId protected_oe property

Auto-generated ID for account role usage
protected string $accountRoleId
return string

$aclType public_oe property

Acl type for test
public string $aclType
return string