/** * Check whether or not currently logged in user * can download theme with the given name. * * @param string $name * @return boolean */ public function canDownloadTheme($name) { $theme = $this->theme->where('name', $name)->first(); if ($theme) { return $this->app['sentry']->getUser()->id == $theme->user_id || $theme->type == 'public'; } }