diff options
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/EditTicketPage.java | 8 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/TicketPage.java | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java index 46781faf..fd5fc607 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java @@ -37,6 +37,7 @@ import org.eclipse.jgit.lib.Repository; import com.gitblit.Constants;
import com.gitblit.Constants.AccessPermission;
+import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.models.RegistrantAccessPermission;
import com.gitblit.models.TicketModel;
import com.gitblit.models.TicketModel.Change;
@@ -163,11 +164,12 @@ public class EditTicketPage extends RepositoryPage { // responsible
Set<String> userlist = new TreeSet<String>(ticket.getParticipants());
- if (UserModel.ANONYMOUS.canPush(getRepositoryModel())) {
- // anonymous push
+ if (UserModel.ANONYMOUS.canPush(getRepositoryModel())
+ || AuthorizationControl.AUTHENTICATED == getRepositoryModel().authorizationControl) {
+ // authorization is ANONYMOUS or AUTHENTICATED (i.e. all users can be set responsible)
userlist.addAll(app().users().getAllUsernames());
} else {
- // authenticated push
+ // authorization is by NAMED users (users with PUSH permission can be set responsible)
for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
userlist.add(rp.registrant);
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index 659acad0..5d51ad18 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -57,6 +57,7 @@ import org.eclipse.jgit.revwalk.RevCommit; import com.gitblit.Constants;
import com.gitblit.Constants.AccessPermission;
+import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.Keys;
import com.gitblit.git.PatchsetCommand;
import com.gitblit.git.PatchsetReceivePack;
@@ -381,9 +382,16 @@ public class TicketPage extends TicketBasePage { * RESPONSIBLE LIST
*/
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())
+ || AuthorizationControl.AUTHENTICATED == getRepositoryModel().authorizationControl) {
+ // authorization is ANONYMOUS or AUTHENTICATED (i.e. all users can be set responsible)
+ userlist.addAll(app().users().getAllUsernames());
+ } else {
+ // authorization is by NAMED users (users with PUSH permission can be set responsible)
+ 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>();
|