summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-05-29 08:43:15 -0600
committerJames Moger <james.moger@gitblit.com>2014-05-29 08:43:15 -0600
commitddb1ebb9b00987773ce60511a82c39b98caf9b70 (patch)
treeee61a6b61ebebb0c0cebaf6f4ee3e9528ceb6088
parentf1926affd9103481a8e9cbd1366e204c5e6d1c26 (diff)
parentc211e9f8cfee42a82c634e722058a3723842b473 (diff)
downloadgitblit-ddb1ebb9b00987773ce60511a82c39b98caf9b70.tar.gz
gitblit-ddb1ebb9b00987773ce60511a82c39b98caf9b70.zip
Merged #91 "Responsible selections do not consider AUTHENTICATED authorization control"
-rw-r--r--src/main/java/com/gitblit/wicket/pages/EditTicketPage.java8
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TicketPage.java14
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>();