\r
GitBlitWebSession session = GitBlitWebSession.get();\r
final UserModel user = session.getUser() == null ? UserModel.ANONYMOUS : session.getUser();\r
-\r
+ final boolean allowEditName = isCreate || isAdmin || repositoryModel.isUsersPersonalRepository(user.username);\r
+ \r
if (isCreate) {\r
if (user.canAdmin()) {\r
super.setupPage(getString("gb.newRepository"), "");\r
return;\r
}\r
\r
- if (user.canCreate() && !user.canAdmin()) {\r
+ if (user.canCreate() && !user.canAdmin() && allowEditName) {\r
// ensure repository name begins with the user's path\r
if (!repositoryModel.name.startsWith(user.getPersonalPath())) {\r
error(MessageFormat.format(getString("gb.illegalPersonalRepositoryLocation"),\r
form.add(new SimpleAttributeModifier("autocomplete", "off"));\r
\r
// field names reflective match RepositoryModel fields\r
- form.add(new TextField<String>("name").setEnabled(isCreate || isAdmin || repositoryModel.isUsersPersonalRepository(user.username)));\r
+ form.add(new TextField<String>("name").setEnabled(allowEditName));\r
form.add(new TextField<String>("description"));\r
form.add(new DropDownChoice<String>("owner", GitBlit.self().getAllUsernames())\r
.setEnabled(GitBlitWebSession.get().canAdmin()));\r