James Moger
2015-11-22 ed552ba47c02779c270ffd62841d6d1048dade70
src/main/java/com/gitblit/servlet/DownloadZipFilter.java
@@ -15,7 +15,13 @@
 */
package com.gitblit.servlet;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.manager.IAuthenticationManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
@@ -27,7 +33,17 @@
 * @author James Moger
 *
 */
@Singleton
public class DownloadZipFilter extends AccessRestrictionFilter {
   @Inject
   public DownloadZipFilter(
         IRuntimeManager runtimeManager,
         IAuthenticationManager authenticationManager,
         IRepositoryManager repositoryManager) {
      super(runtimeManager, authenticationManager, repositoryManager);
   }
   /**
    * Extract the repository name from the url.
@@ -65,7 +81,7 @@
    * @return true if the filter allows repository creation
    */
   @Override
   protected boolean isCreationAllowed() {
   protected boolean isCreationAllowed(String action) {
      return false;
   }
@@ -74,10 +90,11 @@
    *
    * @param repository
    * @param action
    * @param method
    * @return true if the action may be performed
    */
   @Override
   protected boolean isActionAllowed(RepositoryModel repository, String action) {
   protected boolean isActionAllowed(RepositoryModel repository, String action, String method) {
      return true;
   }
@@ -86,10 +103,11 @@
    *
    * @param repository
    * @param action
    * @param method
    * @return true if authentication required
    */
   @Override
   protected boolean requiresAuthentication(RepositoryModel repository, String action) {
   protected boolean requiresAuthentication(RepositoryModel repository, String action, String method) {
      return repository.accessRestriction.atLeast(AccessRestrictionType.VIEW);
   }