public boolean setUserAccessPermissions(RepositoryModel repository, Collection<RegistrantAccessPermission> permissions) {\r
List<UserModel> users = new ArrayList<UserModel>();\r
for (RegistrantAccessPermission up : permissions) {\r
- if (up.isEditable) {\r
+ if (up.mutable) {\r
// only set editable defined permissions\r
UserModel user = userService.getUserModel(up.registrant);\r
user.setRepositoryPermission(repository.name, up.permission);\r
public boolean setTeamAccessPermissions(RepositoryModel repository, Collection<RegistrantAccessPermission> permissions) {\r
List<TeamModel> teams = new ArrayList<TeamModel>();\r
for (RegistrantAccessPermission tp : permissions) {\r
- if (tp.isEditable) {\r
+ if (tp.mutable) {\r
// only set explicitly defined access permissions\r
TeamModel team = userService.getTeamModel(tp.registrant);\r
team.setRepositoryPermission(repository.name, tp.permission);\r
permissions = new ArrayList<RegistrantAccessPermission>();\r
}\r
for (RegistrantAccessPermission rp : permissions) {\r
- if (rp.isEditable) {\r
+ if (rp.mutable) {\r
// only remove editable duplicates\r
// this allows for specifying an explicit permission\r
filtered.remove(rp.registrant);\r
// and therefore can not be directly manipulated unless the current\r
// object is the source of the regex (i.e. a user or team with explicit\r
// regex definition)\r
- return permissions.get(rowIndex).isEditable;\r
+ return permissions.get(rowIndex).mutable;\r
}\r
return false;\r
}\r
\r
List<RegistrantAccessPermission> permissions = user.getRepositoryPermissions();\r
for (RegistrantAccessPermission permission : permissions) {\r
- if (permission.isEditable && PermissionType.EXPLICIT.equals(permission.permissionType)) {\r
+ if (permission.mutable && PermissionType.EXPLICIT.equals(permission.permissionType)) {\r
// Ensure this is NOT an owner permission - which is non-editable\r
// We don't know this from within the usermodel, ownership is a\r
// property of a repository.\r
boolean isOwner = rm.isOwner(user.username);\r
if (isOwner) {\r
permission.permissionType = PermissionType.OWNER;\r
- permission.isEditable = false;\r
+ permission.mutable = false;\r
}\r
}\r
}\r
public AccessPermission permission;
public RegistrantType registrantType;
public PermissionType permissionType;
- public boolean isEditable;
+ public boolean mutable;
public String source;
public RegistrantAccessPermission() {
public RegistrantAccessPermission(RegistrantType registrantType) {
this.registrantType = registrantType;
this.permissionType = PermissionType.EXPLICIT;
- this.isEditable = true;
+ this.mutable = true;
}
- public RegistrantAccessPermission(String registrant, AccessPermission permission, PermissionType permissionType, RegistrantType registrantType, String source, boolean isEditable) {
+ public RegistrantAccessPermission(String registrant, AccessPermission permission, PermissionType permissionType, RegistrantType registrantType, String source, boolean mutable) {
this.registrant = registrant;
this.permission = permission;
this.permissionType = permissionType;
this.registrantType = registrantType;
this.source = source;
- this.isEditable = isEditable;
+ this.mutable = mutable;
}
public boolean isAdmin() {
ap.registrant = name;\r
ap.registrantType = RegistrantType.TEAM;\r
ap.permission = AccessPermission.NONE;\r
- ap.isEditable = false;\r
+ ap.mutable = false;\r
\r
if (canAdmin) {\r
ap.permissionType = PermissionType.ADMINISTRATOR;\r
if (p != null) {\r
ap.permissionType = PermissionType.EXPLICIT;\r
ap.permission = p;\r
- ap.isEditable = true;\r
+ ap.mutable = true;\r
return ap;\r
}\r
} else {\r
ap.registrant = username;\r
ap.registrantType = RegistrantType.USER;\r
ap.permission = AccessPermission.NONE;\r
- ap.isEditable = false;\r
+ ap.mutable = false;\r
\r
// administrator\r
if (canAdmin()) {\r
if (p != null) {\r
ap.permissionType = PermissionType.EXPLICIT;\r
ap.permission = p;\r
- ap.isEditable = true;\r
+ ap.mutable = true;\r
return ap;\r
}\r
} else {\r
final String oldName = userModel.username;\r
final List<RegistrantAccessPermission> permissions = userModel.getRepositoryPermissions();\r
for (RegistrantAccessPermission permission : permissions) {\r
- if (permission.isEditable && PermissionType.EXPLICIT.equals(permission.permissionType)) {\r
+ if (permission.mutable && PermissionType.EXPLICIT.equals(permission.permissionType)) {\r
// Ensure this is NOT an owner permission - which is non-editable\r
// We don't know this from within the usermodel, ownership is a\r
// property of a repository.\r
RepositoryModel rm = GitBlit.self().getRepositoryModel(permission.registrant);\r
if (rm == null) {\r
- LoggerFactory.getLogger(getClass()).error("Missing repository " + permission.registrant, new NullPointerException());\r
+ LoggerFactory.getLogger(getClass()).error("Missing repository " + permission.registrant);\r
continue;\r
}\r
boolean isOwner = rm.isOwner(oldName);\r
if (isOwner) {\r
permission.permissionType = PermissionType.OWNER;\r
- permission.isEditable = false;\r
+ permission.mutable = false;\r
}\r
}\r
}\r
// 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;
// filter out registrants we already have permissions for
final List<String> registrants = new ArrayList<String>(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);