Skip to content

Commit

Permalink
TIM-45: Allow project managers and controllers see the interpretation…
Browse files Browse the repository at this point in the history
… of other people

Just developers may only see their own data
  • Loading branch information
cweiske committed Jan 19, 2021
1 parent 23a0f2e commit 7358a62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/Netresearch/TimeTrackerBundle/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,4 @@ protected function translate(

return $translator->trans($id, $parameters, $domain, $locale);
}

/**
* Returns true, if the functionality of the calling method violates the GDPR.
*
* @return bool
*/
protected function isHiddenCausedByGDPRViolation()
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,14 @@ public function getCustomersAction(Request $request)
}

/**
* Developers may see their own data only, CTL and PL may see everyone.
*
* @param Request $request
* @return Response
*/
public function getUsersAction(Request $request)
{
if ($this->isHiddenCausedByGDPRViolation()) {
if ($this->isDEV($request)) {
$data = $this->getDoctrine()->getRepository('NetresearchTimeTrackerBundle:User')->getUserById($this->getUserId($request));
} else {
$data = $this->getDoctrine()->getRepository('NetresearchTimeTrackerBundle:User')->getUsers($this->getUserId($request));
Expand Down
9 changes: 0 additions & 9 deletions web/app_dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@

// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (strpos($_SERVER['HTTP_HOST'],'timetracker.sobol.nr') === FALSE
&& ( isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
)
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

/* @var Composer\Autoload\ClassLoader */
$loader = require __DIR__.'/../app/autoload.php';
Expand Down

0 comments on commit 7358a62

Please sign in to comment.