user->isAdmin(); } /** * @throws BadRequest * @throws Forbidden * @throws NotFound */ public function postActionDeployToUsers(Request $request): bool { $data = $request->getParsedBody(); if (empty($data->id)) { throw new BadRequest(); } if (empty($data->userIdList)) { throw new BadRequest(); } $this->getDashboardTemplateService()->deployTemplateToUsers( $data->id, $data->userIdList, !empty($data->append) ); return true; } /** * @throws BadRequest * @throws NotFound */ public function postActionDeployToTeam(Request $request): bool { $data = $request->getParsedBody(); if (empty($data->id)) { throw new BadRequest(); } if (empty($data->teamId)) { throw new BadRequest(); } $this->getDashboardTemplateService()->deployTemplateToTeam( $data->id, $data->teamId, !empty($data->append) ); return true; } private function getDashboardTemplateService(): Service { return $this->injectableFactory->create(Service::class); } }