Commits

Sebastian Sdorra committed e0037ce

fix missing group permission check

  • Participants
  • Parent commits 6dcce54
  • Branches apache-shiro

Comments (0)

Files changed (1)

scm-core/src/main/java/sonia/scm/repository/PermissionUtil.java

 import org.slf4j.LoggerFactory;
 
 import sonia.scm.config.ScmConfiguration;
+import sonia.scm.group.GroupNames;
 import sonia.scm.security.Role;
 import sonia.scm.security.ScmSecurityException;
 import sonia.scm.util.AssertUtil;
 
 //~--- JDK imports ------------------------------------------------------------
 
-import java.util.Collection;
 import java.util.List;
 
 /**
 
         if (permissions != null)
         {
+          GroupNames groupNames =
+            subject.getPrincipals().oneByType(GroupNames.class);
 
-          // TODO
+          result = hasPermission(permissions, username, groupNames, pt);
 
-          /*
-           * result = hasPermission(permissions, username,
-           *                      securityContext.getGroups(), pt);
-           */
         }
       }
     }
    * @return
    */
   private static boolean hasPermission(List<Permission> permissions,
-    String username, Collection<String> groups, PermissionType pt)
+    String username, GroupNames groups, PermissionType pt)
   {
     boolean result = false;