public function get() {
$clientid = intval($this->Request['id']);
$client = $this->getModule('client')->getClientById($clientid);
- if(!is_null($client)) {
+ $allowedClients = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.client'), $this->user)->output;
+ if(!is_null($client) && in_array($client->name, $allowedClients)) {
$this->output = $client;
$this->error = ClientError::ERROR_NO_ERRORS;
} else {
public function get() {
$filesetid = intval($this->Request['id']);
$fileset = $this->getModule('fileset')->getFileSetById($filesetid);
- if(!is_null($fileset)) {
+ $allowedFileSets = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.fileset'), $this->user)->output;
+ if(!is_null($fileset) && in_array($fileset->fileset, $allowedFileSets)) {
$this->output = $fileset;
$this->error = FileSetError::ERROR_NO_ERRORS;
} else {
public function get() {
$jobid = intval($this->Request['id']);
$job = $this->getModule('job')->getJobById($jobid);
- if(!is_null($job)) {
+ $allowedJobs = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.jobs'), $this->user)->output;
+ if(!is_null($job) && in_array($job->name, $allowedJobs)) {
$this->output = $job;
$this->error = JobError::ERROR_NO_ERRORS;
} else {
public function get() {
$poolid = intval($this->Request['id']);
$pool = $this->getModule('pool')->getPoolById($poolid);
- if(!is_null($pool)) {
+ $allowedPools = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.pool'), $this->user)->output;
+ if(!is_null($pool) && in_array($pool->name, $allowedPools)) {
$this->output = $pool;
$this->error = PoolError::ERROR_NO_ERRORS;
} else {
public function get() {
$storageid = intval($this->Request['id']);
$storage = $this->getModule('storage')->getStorageById($storageid);
- if(!is_null($storage)) {
+ $allowedStorages = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.storage'), $this->user)->output;
+ if(!is_null($storage) && in_array($storage->name, $allowedStorages)) {
$this->output = $storage;
$this->error = StorageError::ERROR_NO_ERRORS;
} else {