Scalr\Model\Entity\Script::checkPermission PHP Method

checkPermission() public method

public checkPermission ( Scalr_Account_User $user, integer $envId )
$user Scalr_Account_User
$envId integer
    public function checkPermission(\Scalr_Account_User $user, $envId)
    {
        if ($this->accountId && $this->accountId != $user->getAccountId()) {
            throw new \Scalr_Exception_InsufficientPermissions();
        }
        if ($this->envId && $this->envId != $envId) {
            throw new \Scalr_Exception_InsufficientPermissions();
        }
    }