Examples of canAdmin()


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

    }
    Fragment status = new Fragment("status", "statusFragment", this);
    status.add(new DropDownChoice<TicketModel.Status>("status", statusModel, statusChoices));
    form.add(status);

    if (currentUser.canAdmin(ticket, getRepositoryModel())) {
      // responsible
      Set<String> userlist = new TreeSet<String>(ticket.getParticipants());

      if (UserModel.ANONYMOUS.canPush(getRepositoryModel())
          || AuthorizationControl.AUTHENTICATED == getRepositoryModel().authorizationControl) {
View Full Code Here

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

    descriptionEditor = new MarkdownTextArea("description", markdownPreviewModel, descriptionPreview);
    descriptionEditor.setRepository(repositoryName);
    form.add(descriptionEditor);

    if (currentUser.canAdmin(null, getRepositoryModel())) {
      // responsible
      Set<String> userlist = new TreeSet<String>();

      if (UserModel.ANONYMOUS.canPush(getRepositoryModel())
          || AuthorizationControl.AUTHENTICATED == getRepositoryModel().authorizationControl) {
View Full Code Here

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

          CommandMetaData.class.getName()));
    }

    UserModel user = getContext().getClient().getUser();
    CommandMetaData meta = dispatcherClass.getAnnotation(CommandMetaData.class);
    if (meta.admin() && !user.canAdmin()) {
      log.debug(MessageFormat.format("excluding admin dispatcher {0} for {1}",
          meta.name(), user.username));
      return;
    }
View Full Code Here

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

          CommandMetaData.class.getName()));
    }

    UserModel user = getContext().getClient().getUser();
    CommandMetaData meta = clazz.getAnnotation(CommandMetaData.class);
    if (meta.admin() && !user.canAdmin()) {
      log.debug(MessageFormat.format("excluding admin command {0} for {1}", meta.name(), user.username));
      return;
    }
    commands.add(clazz);
  }
View Full Code Here

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

          CommandMetaData.class.getName()));
    }

    UserModel user = getContext().getClient().getUser();
    CommandMetaData meta = cmd.getClass().getAnnotation(CommandMetaData.class);
    if (meta.admin() && !user.canAdmin()) {
      log.debug(MessageFormat.format("excluding admin command {0} for {1}", meta.name(), user.username));
      return;
    }
    commands.add(cmd.getClass());
    instantiated.add(cmd);
View Full Code Here

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

        add(new Label("username", user.getDisplayName()));
      }

      List<MenuItem> standardItems = new ArrayList<MenuItem>();
      standardItems.add(new MenuDivider());
      if (user.canAdmin() || user.canCreate()) {
        standardItems.add(new PageLinkMenuItem("gb.newRepository", app().getNewRepositoryPage()));
      }
      standardItems.add(new PageLinkMenuItem("gb.myProfile", UserPage.class,
          WicketUtils.newUsernameParameter(user.username)));
      if (editCredentials) {
View Full Code Here

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

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

  @Test
  public void testForkTeamInheritance() throws Exception {
    UserModel user = new UserModel("test");
View Full Code Here

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

        // admin page
        if (allowAdmin) {
          if (authenticateAdmin) {
            // authenticate admin
            if (user != null) {
              return user.canAdmin();
            }
            return false;
          } else {
            // no admin authentication required
            return true;
View Full Code Here

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

    UserModel user = GitBlitWebSession.get().getUser();
    if (user == null) {
      user = UserModel.ANONYMOUS;
    }
    Fragment repositoryLinks;
    if (user.canAdmin(entry)) {
      repositoryLinks = new Fragment("repositoryLinks", "repositoryOwnerLinks", this);
      repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class,
          WicketUtils.newRepositoryParameter(entry.name)));
    } else {
      repositoryLinks = new Fragment("repositoryLinks", "repositoryUserLinks", this);
View Full Code Here

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

    Set<String> pathNames = new TreeSet<String>();

    // add the registered/known projects
    for (ProjectModel project : app().projects().getProjectModels(user, false)) {
      // TODO issue-351: user.canAdmin(project)
      if (user.canAdmin()) {
        if (project.isRoot) {
          pathNames.add("/");
        } else {
          pathNames.add(project.name + "/");
        }
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.