Commits

Sebastian Sdorra  committed ac230fb

permission type enum is always upper case

  • Participants
  • Parent commits 2d6f57d
  • Branches apache-shiro

Comments (0)

Files changed (1)

File scm-webapp/src/main/java/sonia/scm/security/RepositoryPermissionResolver.java

 
 import com.google.common.base.Splitter;
 
-import org.apache.shiro.authz.Permission;
 import org.apache.shiro.authz.permission.PermissionResolver;
 
 import org.slf4j.Logger;
 //~--- JDK imports ------------------------------------------------------------
 
 import java.util.Iterator;
+import java.util.Locale;
 
 /**
  *
    * @return
    */
   @Override
-  public Permission resolvePermission(String permissionString)
+  public RepositoryPermission resolvePermission(String permissionString)
   {
     RepositoryPermission permission = null;
     Iterator<String> permissionIt =
       {
         try
         {
-          PermissionType type = PermissionType.valueOf(permissionIt.next());
+          String typeString = permissionIt.next();
+
+          typeString = typeString.trim().toUpperCase(Locale.ENGLISH);
+
+          PermissionType type = PermissionType.valueOf(typeString);
 
           permission = new RepositoryPermission(repositoryId, type);
         }