From 40b07bca7d02438cd0d660f3b1713ffa86f6df76 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 31 Oct 2012 23:33:05 -0400 Subject: [PATCH] Renamed isEditable to mutable --- src/com/gitblit/GitBlit.java | 4 ++-- src/com/gitblit/client/RegistrantPermissionsPanel.java | 2 +- .../gitblit/client/RegistrantPermissionsTableModel.java | 2 +- src/com/gitblit/client/UsersPanel.java | 4 ++-- src/com/gitblit/models/RegistrantAccessPermission.java | 8 ++++---- src/com/gitblit/models/TeamModel.java | 4 ++-- src/com/gitblit/models/UserModel.java | 4 ++-- src/com/gitblit/wicket/pages/EditUserPage.java | 6 +++--- .../gitblit/wicket/panels/RegistrantPermissionsPanel.java | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index a5d8b9e5..eccd7c11 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -692,7 +692,7 @@ public class GitBlit implements ServletContextListener { public boolean setUserAccessPermissions(RepositoryModel repository, Collection permissions) { List users = new ArrayList(); for (RegistrantAccessPermission up : permissions) { - if (up.isEditable) { + if (up.mutable) { // only set editable defined permissions UserModel user = userService.getUserModel(up.registrant); user.setRepositoryPermission(repository.name, up.permission); @@ -832,7 +832,7 @@ public class GitBlit implements ServletContextListener { public boolean setTeamAccessPermissions(RepositoryModel repository, Collection permissions) { List teams = new ArrayList(); for (RegistrantAccessPermission tp : permissions) { - if (tp.isEditable) { + if (tp.mutable) { // only set explicitly defined access permissions TeamModel team = userService.getTeamModel(tp.registrant); team.setRepositoryPermission(repository.name, tp.permission); diff --git a/src/com/gitblit/client/RegistrantPermissionsPanel.java b/src/com/gitblit/client/RegistrantPermissionsPanel.java index 8ae23e9a..c28724c7 100644 --- a/src/com/gitblit/client/RegistrantPermissionsPanel.java +++ b/src/com/gitblit/client/RegistrantPermissionsPanel.java @@ -133,7 +133,7 @@ public class RegistrantPermissionsPanel extends JPanel { permissions = new ArrayList(); } for (RegistrantAccessPermission rp : permissions) { - if (rp.isEditable) { + if (rp.mutable) { // only remove editable duplicates // this allows for specifying an explicit permission filtered.remove(rp.registrant); diff --git a/src/com/gitblit/client/RegistrantPermissionsTableModel.java b/src/com/gitblit/client/RegistrantPermissionsTableModel.java index 1df6bbc2..28d25345 100644 --- a/src/com/gitblit/client/RegistrantPermissionsTableModel.java +++ b/src/com/gitblit/client/RegistrantPermissionsTableModel.java @@ -104,7 +104,7 @@ public class RegistrantPermissionsTableModel extends AbstractTableModel { // and therefore can not be directly manipulated unless the current // object is the source of the regex (i.e. a user or team with explicit // regex definition) - return permissions.get(rowIndex).isEditable; + return permissions.get(rowIndex).mutable; } return false; } diff --git a/src/com/gitblit/client/UsersPanel.java b/src/com/gitblit/client/UsersPanel.java index 2c1481a4..2c236958 100644 --- a/src/com/gitblit/client/UsersPanel.java +++ b/src/com/gitblit/client/UsersPanel.java @@ -316,7 +316,7 @@ public abstract class UsersPanel extends JPanel { List permissions = user.getRepositoryPermissions(); for (RegistrantAccessPermission permission : permissions) { - if (permission.isEditable && PermissionType.EXPLICIT.equals(permission.permissionType)) { + if (permission.mutable && PermissionType.EXPLICIT.equals(permission.permissionType)) { // Ensure this is NOT an owner permission - which is non-editable // We don't know this from within the usermodel, ownership is a // property of a repository. @@ -329,7 +329,7 @@ public abstract class UsersPanel extends JPanel { boolean isOwner = rm.isOwner(user.username); if (isOwner) { permission.permissionType = PermissionType.OWNER; - permission.isEditable = false; + permission.mutable = false; } } } diff --git a/src/com/gitblit/models/RegistrantAccessPermission.java b/src/com/gitblit/models/RegistrantAccessPermission.java index 2d0b90b8..0b28d197 100644 --- a/src/com/gitblit/models/RegistrantAccessPermission.java +++ b/src/com/gitblit/models/RegistrantAccessPermission.java @@ -35,7 +35,7 @@ public class RegistrantAccessPermission implements Serializable, Comparable { ap.registrant = name; ap.registrantType = RegistrantType.TEAM; ap.permission = AccessPermission.NONE; - ap.isEditable = false; + ap.mutable = false; if (canAdmin) { ap.permissionType = PermissionType.ADMINISTRATOR; @@ -205,7 +205,7 @@ public class TeamModel implements Serializable, Comparable { if (p != null) { ap.permissionType = PermissionType.EXPLICIT; ap.permission = p; - ap.isEditable = true; + ap.mutable = true; return ap; } } else { diff --git a/src/com/gitblit/models/UserModel.java b/src/com/gitblit/models/UserModel.java index e81d7ca2..7742d5d9 100644 --- a/src/com/gitblit/models/UserModel.java +++ b/src/com/gitblit/models/UserModel.java @@ -252,7 +252,7 @@ public class UserModel implements Principal, Serializable, Comparable ap.registrant = username; ap.registrantType = RegistrantType.USER; ap.permission = AccessPermission.NONE; - ap.isEditable = false; + ap.mutable = false; // administrator if (canAdmin()) { @@ -291,7 +291,7 @@ public class UserModel implements Principal, Serializable, Comparable if (p != null) { ap.permissionType = PermissionType.EXPLICIT; ap.permission = p; - ap.isEditable = true; + ap.mutable = true; return ap; } } else { diff --git a/src/com/gitblit/wicket/pages/EditUserPage.java b/src/com/gitblit/wicket/pages/EditUserPage.java index 05aee6dc..45de1bef 100644 --- a/src/com/gitblit/wicket/pages/EditUserPage.java +++ b/src/com/gitblit/wicket/pages/EditUserPage.java @@ -107,19 +107,19 @@ public class EditUserPage extends RootSubPage { final String oldName = userModel.username; final List permissions = userModel.getRepositoryPermissions(); for (RegistrantAccessPermission permission : permissions) { - if (permission.isEditable && PermissionType.EXPLICIT.equals(permission.permissionType)) { + if (permission.mutable && PermissionType.EXPLICIT.equals(permission.permissionType)) { // Ensure this is NOT an owner permission - which is non-editable // We don't know this from within the usermodel, ownership is a // property of a repository. RepositoryModel rm = GitBlit.self().getRepositoryModel(permission.registrant); if (rm == null) { - LoggerFactory.getLogger(getClass()).error("Missing repository " + permission.registrant, new NullPointerException()); + LoggerFactory.getLogger(getClass()).error("Missing repository " + permission.registrant); continue; } boolean isOwner = rm.isOwner(oldName); if (isOwner) { permission.permissionType = PermissionType.OWNER; - permission.isEditable = false; + permission.mutable = false; } } } diff --git a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java index d6bd5652..a34ac71f 100644 --- a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java +++ b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java @@ -159,9 +159,9 @@ public class RegistrantPermissionsPanel extends BasePanel { // only allow changing an explicitly defined permission // this is designed to prevent changing a regex permission in // a repository - permissionChoice.setEnabled(entry.isEditable); + permissionChoice.setEnabled(entry.mutable); permissionChoice.setOutputMarkupId(true); - if (entry.isEditable) { + if (entry.mutable) { permissionChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") { private static final long serialVersionUID = 1L; @@ -181,7 +181,7 @@ public class RegistrantPermissionsPanel extends BasePanel { // filter out registrants we already have permissions for final List registrants = new ArrayList(allRegistrants); for (RegistrantAccessPermission rp : permissions) { - if (rp.isEditable) { + if (rp.mutable) { // remove editable duplicates // this allows for specifying an explicit permission registrants.remove(rp.registrant); -- 2.39.5