org.apache.archiva.security
Class DefaultUserRepositories

java.lang.Object
  extended by org.apache.archiva.security.DefaultUserRepositories
All Implemented Interfaces:
UserRepositories

@Service(value="userRepositories")
public class DefaultUserRepositories
extends Object
implements UserRepositories

DefaultUserRepositories


Field Summary
private  org.slf4j.Logger log
           
private  ManagedRepositoryAdmin managedRepositoryAdmin
           
private  org.apache.archiva.redback.role.RoleManager roleManager
           
private  org.apache.archiva.redback.system.SecuritySystem securitySystem
           
 
Constructor Summary
DefaultUserRepositories()
           
 
Method Summary
 void createMissingRepositoryRoles(String repoId)
          Create any missing repository roles for the provided repository id.
private  org.apache.archiva.redback.system.SecuritySession createSession(String principal)
           
 List<ManagedRepository> getAccessibleRepositories(String principal)
           
private  List<ManagedRepository> getAccessibleRepositories(String principal, String operation)
           
private  List<String> getAccessibleRepositoryIds(String principal, String operation)
           
 List<String> getManagableRepositoryIds(String principal)
          Get the list of writable repository ids for the user specified.
 List<String> getObservableRepositoryIds(String principal)
          Get the list of observable repository ids for the user specified.
 org.apache.archiva.redback.role.RoleManager getRoleManager()
           
 org.apache.archiva.redback.system.SecuritySystem getSecuritySystem()
           
 boolean isAuthorizedToDeleteArtifacts(String principal, String repoId)
          Check if user is authorized to delete artifacts in the repository.
 boolean isAuthorizedToUploadArtifacts(String principal, String repoId)
          Check if user is authorized to upload artifacts in the repository.
 void setRoleManager(org.apache.archiva.redback.role.RoleManager roleManager)
           
 void setSecuritySystem(org.apache.archiva.redback.system.SecuritySystem securitySystem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securitySystem

@Inject
private org.apache.archiva.redback.system.SecuritySystem securitySystem

roleManager

@Inject
private org.apache.archiva.redback.role.RoleManager roleManager

managedRepositoryAdmin

@Inject
private ManagedRepositoryAdmin managedRepositoryAdmin

log

private org.slf4j.Logger log
Constructor Detail

DefaultUserRepositories

public DefaultUserRepositories()
Method Detail

getObservableRepositoryIds

public List<String> getObservableRepositoryIds(String principal)
                                        throws PrincipalNotFoundException,
                                               AccessDeniedException,
                                               ArchivaSecurityException
Description copied from interface: UserRepositories
Get the list of observable repository ids for the user specified.

Specified by:
getObservableRepositoryIds in interface UserRepositories
Parameters:
principal - the principle to obtain the observable repository ids from.
Returns:
the list of observable repository ids.
Throws:
PrincipalNotFoundException
AccessDeniedException
ArchivaSecurityException

getManagableRepositoryIds

public List<String> getManagableRepositoryIds(String principal)
                                       throws PrincipalNotFoundException,
                                              AccessDeniedException,
                                              ArchivaSecurityException
Description copied from interface: UserRepositories
Get the list of writable repository ids for the user specified.

Specified by:
getManagableRepositoryIds in interface UserRepositories
Parameters:
principal - the principle to obtain the observable repository ids from.
Returns:
the list of observable repository ids.
Throws:
PrincipalNotFoundException
AccessDeniedException
ArchivaSecurityException

getAccessibleRepositoryIds

private List<String> getAccessibleRepositoryIds(String principal,
                                                String operation)
                                         throws ArchivaSecurityException,
                                                AccessDeniedException,
                                                PrincipalNotFoundException
Throws:
ArchivaSecurityException
AccessDeniedException
PrincipalNotFoundException

getAccessibleRepositories

public List<ManagedRepository> getAccessibleRepositories(String principal)
                                                  throws ArchivaSecurityException,
                                                         AccessDeniedException,
                                                         PrincipalNotFoundException
Specified by:
getAccessibleRepositories in interface UserRepositories
Returns:
Throws:
ArchivaSecurityException
AccessDeniedException
PrincipalNotFoundException

getAccessibleRepositories

private List<ManagedRepository> getAccessibleRepositories(String principal,
                                                          String operation)
                                                   throws ArchivaSecurityException,
                                                          AccessDeniedException,
                                                          PrincipalNotFoundException
Throws:
ArchivaSecurityException
AccessDeniedException
PrincipalNotFoundException

createSession

private org.apache.archiva.redback.system.SecuritySession createSession(String principal)
                                                                 throws ArchivaSecurityException,
                                                                        AccessDeniedException
Throws:
ArchivaSecurityException
AccessDeniedException

createMissingRepositoryRoles

public void createMissingRepositoryRoles(String repoId)
                                  throws ArchivaSecurityException
Description copied from interface: UserRepositories
Create any missing repository roles for the provided repository id.

Specified by:
createMissingRepositoryRoles in interface UserRepositories
Parameters:
repoId - the repository id to work off of.
Throws:
ArchivaSecurityException - if there was a problem creating the repository roles.

isAuthorizedToUploadArtifacts

public boolean isAuthorizedToUploadArtifacts(String principal,
                                             String repoId)
                                      throws PrincipalNotFoundException,
                                             ArchivaSecurityException
Description copied from interface: UserRepositories
Check if user is authorized to upload artifacts in the repository.

Specified by:
isAuthorizedToUploadArtifacts in interface UserRepositories
Returns:
Throws:
PrincipalNotFoundException
ArchivaSecurityException

isAuthorizedToDeleteArtifacts

public boolean isAuthorizedToDeleteArtifacts(String principal,
                                             String repoId)
                                      throws ArchivaSecurityException
Description copied from interface: UserRepositories
Check if user is authorized to delete artifacts in the repository.

Specified by:
isAuthorizedToDeleteArtifacts in interface UserRepositories
Returns:
Throws:
ArchivaSecurityException
AccessDeniedException

getSecuritySystem

public org.apache.archiva.redback.system.SecuritySystem getSecuritySystem()

setSecuritySystem

public void setSecuritySystem(org.apache.archiva.redback.system.SecuritySystem securitySystem)

getRoleManager

public org.apache.archiva.redback.role.RoleManager getRoleManager()

setRoleManager

public void setRoleManager(org.apache.archiva.redback.role.RoleManager roleManager)


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.