if (objectId != null) {\r
RefModel branch = null;\r
if ((branch = JGitUtils.getBranch(getRepository(), objectId)) != null) {\r
- boolean canAccess = GitBlitWebSession\r
- .get()\r
- .getUser()\r
- .hasBranchPermission(getRepositoryModel().name,\r
+ UserModel user = GitBlitWebSession.get().getUser();\r
+ if (user == null) {\r
+ // workaround until get().getUser() is reviewed throughout the app\r
+ user = UserModel.ANONYMOUS;\r
+ }\r
+ boolean canAccess = user.hasBranchPermission(repositoryName,\r
branch.reference.getName());\r
if (!canAccess) {\r
error("Access denied", true);\r