summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-05-12 08:47:55 -0400
committerJames Moger <james.moger@gitblit.com>2014-05-12 08:47:55 -0400
commita3dd0d0416fe093852293bcedb83c9b1e6fe06cb (patch)
tree4eb56fd9ee9d12b36c457d18fcd023f43372f077
parentfc2230321686713ce14a601ab2843d96af474036 (diff)
parenteb61292adce83ee88561fb7df3fb2ddf2d34a282 (diff)
downloadgitblit-a3dd0d0416fe093852293bcedb83c9b1e6fe06cb.tar.gz
gitblit-a3dd0d0416fe093852293bcedb83c9b1e6fe06cb.zip
Merge branch 'ticket/71' into develop
-rw-r--r--src/main/java/com/gitblit/wicket/pages/EditTicketPage.java14
-rw-r--r--src/main/java/com/gitblit/wicket/pages/NewTicketPage.java18
2 files changed, 24 insertions, 8 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
index c3294ba2..46781faf 100644
--- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
@@ -163,16 +163,22 @@ public class EditTicketPage extends RepositoryPage {
// responsible
Set<String> userlist = new TreeSet<String>(ticket.getParticipants());
- for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
- if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
- userlist.add(rp.registrant);
+ if (UserModel.ANONYMOUS.canPush(getRepositoryModel())) {
+ // anonymous push
+ userlist.addAll(app().users().getAllUsernames());
+ } else {
+ // authenticated push
+ for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
+ if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
+ userlist.add(rp.registrant);
+ }
}
}
List<TicketResponsible> responsibles = new ArrayList<TicketResponsible>();
for (String username : userlist) {
UserModel user = app().users().getUserModel(username);
- if (user != null) {
+ if (user != null && !user.disabled) {
TicketResponsible responsible = new TicketResponsible(user);
responsibles.add(responsible);
if (user.username.equals(ticket.responsible)) {
diff --git a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java
index cc0474a2..961590a2 100644
--- a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java
@@ -116,13 +116,23 @@ public class NewTicketPage extends RepositoryPage {
if (currentUser.canAdmin(null, getRepositoryModel())) {
// responsible
List<TicketResponsible> responsibles = new ArrayList<TicketResponsible>();
- for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
- if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
- UserModel user = app().users().getUserModel(rp.registrant);
- if (user != null) {
+ if (UserModel.ANONYMOUS.canPush(getRepositoryModel())) {
+ // anonymous push allowed
+ for (UserModel user : app().users().getAllUsers()) {
+ if (!user.disabled) {
responsibles.add(new TicketResponsible(user));
}
}
+ } else {
+ // authenticated push
+ for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
+ if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
+ UserModel user = app().users().getUserModel(rp.registrant);
+ if (user != null && !user.disabled) {
+ responsibles.add(new TicketResponsible(user));
+ }
+ }
+ }
}
Collections.sort(responsibles);
Fragment responsible = new Fragment("responsible", "responsibleFragment", this);