1 package org.apache.archiva.web.action.admin.repositories;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.admin.model.RepositoryCommonValidator;
23 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
24 import org.apache.archiva.audit.Auditable;
25 import org.apache.archiva.security.common.ArchivaRoleConstants;
26 import org.apache.archiva.web.action.AbstractActionSupport;
27 import org.apache.archiva.redback.rbac.Resource;
28 import org.apache.archiva.redback.integration.interceptor.SecureAction;
29 import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
30 import org.apache.archiva.redback.integration.interceptor.SecureActionException;
32 import javax.inject.Inject;
35 * Abstract AdminRepositories Action base.
37 * Base class for all repository administrative functions.
38 * This should be neutral to the type of action (add/edit/delete) and type of repo (managed/remote)
42 public abstract class AbstractRepositoriesAdminAction
43 extends AbstractActionSupport
44 implements SecureAction, Auditable
48 private ManagedRepositoryAdmin managedRepositoryAdmin;
51 private RepositoryCommonValidator repositoryCommonValidator;
54 public SecureActionBundle getSecureActionBundle()
55 throws SecureActionException
57 SecureActionBundle bundle = new SecureActionBundle();
59 bundle.setRequiresAuthentication( true );
60 bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
67 public ManagedRepositoryAdmin getManagedRepositoryAdmin()
69 return managedRepositoryAdmin;
72 public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin )
74 this.managedRepositoryAdmin = managedRepositoryAdmin;
77 public RepositoryCommonValidator getRepositoryCommonValidator()
79 return repositoryCommonValidator;
82 public void setRepositoryCommonValidator( RepositoryCommonValidator repositoryCommonValidator )
84 this.repositoryCommonValidator = repositoryCommonValidator;