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 * Create any missing repository roles for the provided repository id.
49 * @param repoId the repository id to work off of.
50 * @throws ArchivaSecurityException if there was a problem creating the repository roles.
52 public void createMissingRepositoryRoles( String repoId )
53 throws ArchivaSecurityException;
56 * Check if user is authorized to upload artifacts in the repository.
61 * @throws PrincipalNotFoundException
62 * @throws ArchivaSecurityException
64 public boolean isAuthorizedToUploadArtifacts( String principal, String repoId)
65 throws PrincipalNotFoundException, ArchivaSecurityException;
68 * Check if user is authorized to delete artifacts in the repository.
73 * @throws RbacManagerException
74 * @throws RbacObjectNotFoundException
76 public boolean isAuthorizedToDeleteArtifacts( String principal, String repoId )
77 throws RbacManagerException, RbacObjectNotFoundException;