1 package org.apache.maven.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.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
23 import org.codehaus.plexus.redback.rbac.RbacManagerException;
25 import java.util.List;
32 public interface UserRepositories
35 * Get the list of observable repository ids for the user specified.
37 * @param principal the principle to obtain the observable repository ids from.
38 * @return the list of observable repository ids.
39 * @throws PrincipalNotFoundException
40 * @throws AccessDeniedException
41 * @throws ArchivaSecurityException
43 public List<String> getObservableRepositoryIds( String principal )
44 throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException;
47 * Get the list of writable repository ids for the user specified.
49 * @param principal the principle to obtain the observable repository ids from.
50 * @return the list of observable repository ids.
51 * @throws PrincipalNotFoundException
52 * @throws AccessDeniedException
53 * @throws ArchivaSecurityException
55 public List<String> getManagableRepositoryIds( String principal )
56 throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException;
59 * Create any missing repository roles for the provided repository id.
61 * @param repoId the repository id to work off of.
62 * @throws ArchivaSecurityException if there was a problem creating the repository roles.
64 public void createMissingRepositoryRoles( String repoId )
65 throws ArchivaSecurityException;
68 * Check if user is authorized to upload artifacts in the repository.
73 * @throws PrincipalNotFoundException
74 * @throws ArchivaSecurityException
76 public boolean isAuthorizedToUploadArtifacts( String principal, String repoId)
77 throws PrincipalNotFoundException, ArchivaSecurityException;
80 * Check if user is authorized to delete artifacts in the repository.
85 * @throws RbacManagerException
86 * @throws RbacObjectNotFoundException
88 public boolean isAuthorizedToDeleteArtifacts( String principal, String repoId )
89 throws RbacManagerException, RbacObjectNotFoundException;