diff options
author | Martin Stockhammer <m.stockhammer@web.de> | 2016-09-14 21:49:30 +0200 |
---|---|---|
committer | Martin Stockhammer <m.stockhammer@web.de> | 2016-09-14 21:49:30 +0200 |
commit | de3eb83242b42d75546670e8859cdb1f59fe4fa6 (patch) | |
tree | 047a0d2cebc7262b765a4e09eb7fc665d3948241 /archiva-modules/archiva-web/archiva-security | |
parent | d01764bed989abc53c20cb79723e59ae390f454a (diff) | |
download | archiva-de3eb83242b42d75546670e8859cdb1f59fe4fa6.tar.gz archiva-de3eb83242b42d75546670e8859cdb1f59fe4fa6.zip |
Adding restricted view for user managable repositories
Adds additional rest method to list the repositories where the user
has manage permissions.
Restricts the view for uploads to only managable repositories.
Diffstat (limited to 'archiva-modules/archiva-web/archiva-security')
2 files changed, 19 insertions, 0 deletions
diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java index 91ff5ea07..4679bc733 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java @@ -99,6 +99,11 @@ public class DefaultUserRepositories return getAccessibleRepositories( principal, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS ); } + @Override + public List<ManagedRepository> getManagableRepositories(String principal) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException { + return getAccessibleRepositories( principal, ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD ); + } + private List<ManagedRepository> getAccessibleRepositories( String principal, String operation ) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException { diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/UserRepositories.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/UserRepositories.java index 6e3881218..493eeced7 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/UserRepositories.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/UserRepositories.java @@ -98,5 +98,19 @@ public interface UserRepositories */ List<ManagedRepository> getAccessibleRepositories( String principal ) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException; + + /** + * + * Returns a list of repositories for which the user has the manager role. + * + * @param principal + * @since 2.2.2 + * @return + * @throws ArchivaSecurityException + * @throws AccessDeniedException + * @throws PrincipalNotFoundException + */ + List<ManagedRepository> getManagableRepositories( String principal ) + throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException; } |