1 package org.apache.archiva.security;
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.beans.ManagedRepository;
24 import java.util.List;
31 public interface UserRepositories
34 * Get the list of observable repository ids for the user specified.
36 * @param principal the principle to obtain the observable repository ids from.
37 * @return the list of observable repository ids.
38 * @throws PrincipalNotFoundException
39 * @throws AccessDeniedException
40 * @throws ArchivaSecurityException
42 List<String> getObservableRepositoryIds( String principal )
43 throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException;
46 * Get the list of writable repository ids for the user specified.
48 * @param principal the principle to obtain the observable repository ids from.
49 * @return the list of observable repository ids.
50 * @throws PrincipalNotFoundException
51 * @throws AccessDeniedException
52 * @throws ArchivaSecurityException
54 List<String> getManagableRepositoryIds( String principal )
55 throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException;
58 * Create any missing repository roles for the provided repository id.
60 * @param repoId the repository id to work off of.
61 * @throws ArchivaSecurityException if there was a problem creating the repository roles.
63 void createMissingRepositoryRoles( String repoId )
64 throws ArchivaSecurityException;
67 * Check if user is authorized to upload artifacts in the repository.
72 * @throws PrincipalNotFoundException
73 * @throws ArchivaSecurityException
75 boolean isAuthorizedToUploadArtifacts( String principal, String repoId)
76 throws PrincipalNotFoundException, ArchivaSecurityException;
79 * Check if user is authorized to delete artifacts in the repository.
84 * @throws ArchivaSecurityException
85 * @throws AccessDeniedException
87 boolean isAuthorizedToDeleteArtifacts( String principal, String repoId )
88 throws AccessDeniedException, ArchivaSecurityException;
95 * @throws ArchivaSecurityException
96 * @throws AccessDeniedException
97 * @throws PrincipalNotFoundException
99 List<ManagedRepository> getAccessibleRepositories( String principal )
100 throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException;