<?php
if(!isset($instance->type)) $instance->type = 'store';
if($instance->type !== 'store')
{
    if($action == 'visit') return true;
    if(!common::hasPriv('instance', 'manage')) return false;
    if($action == 'bindUser' && $instance->appName == 'GitFox') return true;
}
else
{
    if($action == 'visit' && in_array($instance->chart, $this->config->instance->cannotVisit)) return false;
    if($action == 'bindUser' && $instance->status == 'running' && $instance->appName == 'GitFox' && $instance->source != 'system') return true;
}
