| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | /**
|
| | | * Returns true if the user is allowed to create the specified repository.
|
| | | * |
| | | * @param repository
|
| | | * @return true if the user can create the repository
|
| | | */
|
| | | public boolean canCreate(String repository) {
|
| | | if (canAdmin()) {
|
| | | // admins can create any repository
|
| | | return true;
|
| | | }
|
| | | if (canCreate) {
|
| | | String projectPath = StringUtils.getFirstPathElement(repository);
|
| | | if (!StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase("~" + username)) {
|
| | | // personal repository
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public boolean isTeamMember(String teamname) {
|
| | | for (TeamModel team : teams) {
|