2 * Copyright 2000-2011 JetBrains s.r.o.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package jetbrains.buildServer.nuget.server.toolRegistry.tab;
\r
19 import jetbrains.buildServer.controllers.AuthorizationInterceptor;
\r
20 import jetbrains.buildServer.controllers.BaseController;
\r
21 import jetbrains.buildServer.controllers.RequestPermissionsChecker;
\r
22 import jetbrains.buildServer.serverSide.SBuildServer;
\r
23 import jetbrains.buildServer.serverSide.auth.AccessDeniedException;
\r
24 import jetbrains.buildServer.serverSide.auth.AuthorityHolder;
\r
25 import jetbrains.buildServer.web.openapi.PluginDescriptor;
\r
26 import jetbrains.buildServer.web.openapi.WebControllerManager;
\r
27 import org.jetbrains.annotations.NotNull;
\r
28 import org.springframework.web.servlet.ModelAndView;
\r
30 import javax.servlet.http.HttpServletRequest;
\r
31 import javax.servlet.http.HttpServletResponse;
\r
34 * Created by Eugene Petrenko (eugene.petrenko@gmail.com)
\r
35 * Date: 10.08.11 20:38
\r
37 public class ServerSettingsController extends BaseController {
\r
38 private final String myPath;
\r
40 public ServerSettingsController(@NotNull final SBuildServer server,
\r
41 @NotNull final AuthorizationInterceptor auth,
\r
42 @NotNull final PermissionChecker checker,
\r
43 @NotNull final WebControllerManager web,
\r
44 @NotNull final PluginDescriptor descriptor) {
\r
46 myPath = descriptor.getPluginResourcesPath("tool/nuget-server-tab.html");
\r
47 auth.addPathBasedPermissionsChecker(myPath, new RequestPermissionsChecker() {
\r
48 public void checkPermissions(@NotNull AuthorityHolder authorityHolder, @NotNull HttpServletRequest request) throws AccessDeniedException {
\r
49 checker.assertAccess(authorityHolder);
\r
52 web.registerController(myPath, this);
\r
56 public String getPath() {
\r
61 protected ModelAndView doHandle(HttpServletRequest request, HttpServletResponse response) throws Exception {
\r
62 return simpleView("Empty nuget tab content");
\r