user->isAdmin(); } 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()->deployToUsers( $data->id, $data->userIdList, !empty($data->append) ); return true; } 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()->deployToTeam( $data->id, $data->teamId, !empty($data->append) ); return true; } private function getDashboardTemplateService(): Service { /** @var Service */ return $this->getRecordService(); } }