Fix anonymous browsing of user profile page
| | |
| | | return !StringUtils.isEmpty(originRepository);
|
| | | }
|
| | |
|
| | | public boolean isOwner(String username) {
|
| | | return owner != null && username != null && owner.equalsIgnoreCase(username);
|
| | | }
|
| | | |
| | | public boolean isPersonalRepository() {
|
| | | return !StringUtils.isEmpty(projectPath) && projectPath.charAt(0) == '~';
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private UserModel() {
|
| | | this.username = "anonymous";
|
| | | this.username = "$anonymous";
|
| | | this.isAuthenticated = false;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | UserModel user = GitBlitWebSession.get().getUser();
|
| | | if (user == null) {
|
| | | user = UserModel.ANONYMOUS;
|
| | | }
|
| | | Fragment repositoryLinks;
|
| | | boolean showOwner = user != null && user.username.equalsIgnoreCase(entry.owner);
|
| | | boolean showOwner = entry.isOwner(user.username);
|
| | | // owner of personal repository gets admin powers
|
| | | boolean showAdmin = isAdmin || entry.isUsersPersonalRepository(user.username);
|
| | |
|