Package com.gitblit.models

Examples of com.gitblit.models.UserModel.canCreate()


    if (repositories.isEmpty()) {
      add(new Label("repositoryList").setVisible(false));
    } else {
      FilterableRepositoryList repoList = new FilterableRepositoryList("repositoryList", repositories);
      repoList.setAllowCreate(user.canCreate(project.name + "/"));
      add(repoList);
    }
  }

  @Override
View Full Code Here


  public void testCreateTeamInheritance() throws Exception {
    UserModel user = new UserModel("test");
    TeamModel team = new TeamModel("team");
    team.canCreate= true;
    user.teams.add(team);
    assertTrue("User did not inherit create privileges", user.canCreate());
  }

  @Test
  public void testIsFrozen() throws Exception {
    RepositoryModel repo = new RepositoryModel("somerepo.git", null, null, new Date());
View Full Code Here

        }
      }
    }

    // add the user's personal project namespace
    if (user.canAdmin() || user.canCreate()) {
      pathNames.add(user.getPersonalPath() + "/");
    }

    if (!StringUtils.isEmpty(repository.name)) {
      // editing a repository name
View Full Code Here

    // if default project is not already set, set preference based on the user permissions
    if (defaultPath == null) {
      if (user.canAdmin()) {
        defaultPath = "/";
      } else if (user.canCreate()) {
        defaultPath = user.getPersonalPath() + "/";
      }
    }

    projectPath = Model.of(defaultPath);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.