private static String[] constructChoices(
      final ConflictManagerExternal conflictManager, boolean allConflictsResolved) {
    String[] choices;
    boolean isAdmin = false;
    try {
      if (AccessControlManager.isOseeAdmin()) {
        isAdmin = true;
      }
    } catch (OseeCoreException ex) {
      isAdmin = false;
      OseeLog.log(Activator.class, Level.SEVERE, ex.toString(), ex);
    }

    if (allConflictsResolved) {
      choices = new String[] {"Commit", "Launch Merge Manager", "Delete Merge", "Cancel"};
    } else {
      if (isAdmin) {
        choices =
            new String[] {
              "Launch Merge Manager", "Delete Merge", "Cancel", "Force Commit (Admin Only)"
            };
      } else {
        choices = new String[] {"Launch Merge Manager", "Delete Merge", "Cancel"};
      }
    }
    return choices;
  }
 @Override
 public boolean isEnabledWithException(IStructuredSelection structuredSelection)
     throws OseeCoreException {
   List<? extends IOseeBranch> branches =
       Handlers.getBranchesFromStructuredSelection(structuredSelection);
   return branches.size() == 1 && AccessControlManager.isOseeAdmin();
 }
示例#3
0
 @Override
 public int minimumRanking() throws OseeCoreException {
   if (AccessControlManager.isOseeAdmin()) {
     return NO_MATCH;
   } else {
     return PRESENTATION_TYPE;
   }
 }
 public static Set<Artifact> getEmailGroupsAndUserGroups(User user) throws OseeCoreException {
   Set<Artifact> artifacts = new HashSet<Artifact>();
   for (Artifact art :
       ArtifactQuery.getArtifactListFromType(
           CoreArtifactTypes.UserGroup, BranchManager.getCommonBranch())) {
     // Only add group if have read permissions
     if (!art.getName().equals("Root Artifact")
         && AccessControlManager.hasPermission(art, PermissionEnum.READ)) {
       artifacts.add(art);
     }
   }
   return artifacts;
 }