Commits

Sebastian Sdorra committed 7f17d62

indent

Comments (0)

Files changed (1)

scm-webapp/src/main/java/sonia/scm/security/ScmRealm.java

 
       for (Permission permission : repositoryPermissions)
       {
-        if ((permission.isGroupPermission()
-          && groups.contains(
-            permission.getName())) || ((!permission.isGroupPermission())
-              && user.getName().equals(permission.getName())))
+        if (isUserPermission(user, groups, permission))
         {
           RepositoryPermission rp = new RepositoryPermission(repository,
                                       permission.getType());
     return result;
   }
 
+  /**
+   * Method description
+   *
+   *
+   * @param user
+   * @param groups
+   * @param perm
+   *
+   * @return
+   */
+  private boolean isUserPermission(User user, GroupNames groups,
+    Permission perm)
+  {
+    //J-
+    return (perm.isGroupPermission() && groups.contains(perm.getName())) 
+      || ((!perm.isGroupPermission()) && user.getName().equals(perm.getName()));
+    //J+
+  }
+
   //~--- fields ---------------------------------------------------------------
 
   /** Field description */