Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-07-26 17:31:38 -0400
committerDonald Dunne2017-07-31 18:59:48 -0400
commitd75a235f8239cdb79635bc43b2847d95ca0a26b6 (patch)
treebd219b436abf2a97ba0e25f67afffbf7f8132f0d
parent5ed5f79aef2b584d8c02b00a2252e0bdbe03f9fc (diff)
downloadorg.eclipse.osee-d75a235f8239cdb79635bc43b2847d95ca0a26b6.tar.gz
org.eclipse.osee-d75a235f8239cdb79635bc43b2847d95ca0a26b6.tar.xz
org.eclipse.osee-d75a235f8239cdb79635bc43b2847d95ca0a26b6.zip
refinement: Remove AtsUtilClient.isAtsAdmin methods
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java16
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java13
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/PrivilegedEditAction.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/TargetedVersionColumnUI.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeOperationsSection.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsSection.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeTargetedVersionHeader.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeWorkFlowTab.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WorkflowEditor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/ATSPerspective.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ToggleAtsAdmin.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewNavigateView.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUserNavigateItems.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PrivilegedUserManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java4
29 files changed, 71 insertions, 58 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
index 6f3b010899..bdb19a1392 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/user/IAtsUserService.java
@@ -57,4 +57,6 @@ public interface IAtsUserService {
IAtsUser getUserByAccountId(Long accountId);
+ boolean isAtsAdmin(boolean useCache);
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
index c247819a41..d3de173260 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
@@ -53,7 +53,7 @@ public class AtsArtifactChecks extends ArtifactCheck {
@Override
public IStatus isDeleteableRelation(Artifact artifact, IRelationType relationType) throws OseeCoreException {
if (deletionChecksEnabled) {
- boolean isAtsAdmin = AtsUtilClient.isAtsAdmin();
+ boolean isAtsAdmin = AtsClientService.get().getUserService().isAtsAdmin();
if (!isAtsAdmin && Admin_Only_Relation_Type_Ids.contains(relationType.getId())) {
return createStatus(
String.format("Deletion of relation type [%s] off artifact [%s] is only permitted by ATS Admin",
@@ -65,7 +65,7 @@ public class AtsArtifactChecks extends ArtifactCheck {
@Override
public IStatus isDeleteable(Collection<Artifact> artifacts) throws OseeCoreException {
- boolean isAtsAdmin = AtsUtilClient.isAtsAdmin();
+ boolean isAtsAdmin = AtsClientService.get().getUserService().isAtsAdmin();
IStatus result = Status.OK_STATUS;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
index d39aaa189a..8a58d98ac2 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
@@ -17,6 +17,7 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.config.IAtsConfigurationProvider;
+import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.AtsUser;
import org.eclipse.osee.ats.api.user.IAtsUser;
@@ -28,6 +29,7 @@ import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
@@ -150,6 +152,20 @@ public class AtsUserServiceClientImpl extends AbstractAtsUserService implements
}
@Override
+ public boolean isAtsAdmin(boolean useCache) {
+ if (!useCache) {
+ Artifact atsAdmin = AtsClientService.get().getArtifact(AtsArtifactToken.AtsAdmin);
+ return atsAdmin.isRelated(CoreRelationTypes.Users_User, getCurrentOseeUser());
+ }
+ return isAtsAdmin();
+ }
+
+ @Override
+ public boolean isAtsAdmin() {
+ return configurationProvider.getConfigurations().getAtsAdmins().contains(getCurrentUser().getId());
+ }
+
+ @Override
public List<? extends IAtsUser> getUsers() {
return configurationProvider.getConfigurations().getUsers();
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
index ebd9345136..6caf69abed 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
@@ -52,7 +52,6 @@ public class AtsUtilClient {
private static List<IEventFilter> atsObjectEventFilter = new ArrayList<>(2);
private static boolean emailEnabled = true;
private static BranchUuidEventFilter commonBranchUuidEventFilter;
- private static Boolean atsAdmin = null;
public static boolean isEmailEnabled() {
return emailEnabled;
@@ -112,18 +111,6 @@ public class AtsUtilClient {
return results;
}
- public static boolean isAtsAdmin(boolean useCache) {
- if (!useCache) {
- atsAdmin = AtsGroup.AtsAdmin.isMember(
- AtsClientService.get().getUserService().getCurrentUser()) || AtsGroup.AtsAdmin.isCurrentUserTemporaryOverride();
- }
- return isAtsAdmin();
- }
-
- public static boolean isAtsAdmin() {
- return AtsClientService.get().getUserService().isAtsAdmin();
- }
-
public static String getAtsId(Artifact art) throws OseeCoreException {
String toReturn = art.getSoleAttributeValueAsString(AtsAttributeTypes.AtsId, AtsUtilCore.DEFAULT_ATS_ID_VALUE);
Conditions.checkNotNull("AtsId", "AtsId");
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
index 49fcb879e9..331842d191 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsUserServiceServerImpl.java
@@ -54,6 +54,16 @@ public class AtsUserServiceServerImpl extends AbstractAtsUserService {
return atsAdminArt.areRelated(CoreRelationTypes.User_Grouping__Members, (ArtifactReadable) user.getStoreObject());
}
+ @Override
+ public boolean isAtsAdmin(boolean useCache) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isAtsAdmin() {
+ throw new UnsupportedOperationException();
+ }
+
private Supplier<List<IAtsUser>> usersCache =
Suppliers.memoizeWithExpiration(getConfigurationsSupplier(), 5, TimeUnit.MINUTES);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/PrivilegedEditAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/PrivilegedEditAction.java
index d333c4baac..b8cea61fb7 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/PrivilegedEditAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/PrivilegedEditAction.java
@@ -54,7 +54,7 @@ public class PrivilegedEditAction extends AbstractAtsAction {
}
} else {
Set<IAtsUser> users = PrivilegedUserManager.getPrivilegedUsers(sma);
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
users.add(AtsClientService.get().getUserService().getCurrentUser());
}
StringBuffer stringBuffer = new StringBuffer();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/TargetedVersionColumnUI.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/TargetedVersionColumnUI.java
index 24772ba6ec..9faa329fa2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/TargetedVersionColumnUI.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/TargetedVersionColumnUI.java
@@ -87,8 +87,8 @@ public class TargetedVersionColumnUI extends XViewerAtsColumnIdColumn implements
return false;
}
boolean modified = promptChangeVersion(Arrays.asList((TeamWorkFlowArtifact) useArt),
- AtsUtilClient.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
- AtsUtilClient.isAtsAdmin() ? VersionLockedType.Both : VersionLockedType.UnLocked);
+ AtsClientService.get().getUserService().isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
+ AtsClientService.get().getUserService().isAtsAdmin() ? VersionLockedType.Both : VersionLockedType.UnLocked);
XViewer xViewer = (XViewer) ((XViewerColumn) treeColumn.getData()).getXViewer();
if (modified && isPersistViewer(xViewer)) {
useArt.persist("persist goals via alt-left-click");
@@ -106,7 +106,7 @@ public class TargetedVersionColumnUI extends XViewerAtsColumnIdColumn implements
}
public static boolean promptChangeVersion(AbstractWorkflowArtifact sma, VersionReleaseType versionReleaseType, VersionLockedType versionLockType) throws OseeCoreException {
- if (AtsUtilClient.isAtsAdmin() && !sma.isTeamWorkflow()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !sma.isTeamWorkflow()) {
AWorkbench.popup("ERROR ", "Cannot set version for: \n\n" + sma.getName());
return false;
}
@@ -124,10 +124,10 @@ public class TargetedVersionColumnUI extends XViewerAtsColumnIdColumn implements
teamArt) || AtsClientService.get().getVersionService().isVersionLocked(teamArt)) {
String error =
"Team Workflow\n \"" + teamArt.getName() + "\"\n targeted version is locked or already released.";
- if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(), "Change Version",
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(), "Change Version",
error + "\n\nOverride?")) {
return false;
- } else if (!AtsUtilClient.isAtsAdmin()) {
+ } else if (!AtsClientService.get().getUserService().isAtsAdmin()) {
AWorkbench.popup("ERROR", error);
continue;
}
@@ -161,10 +161,10 @@ public class TargetedVersionColumnUI extends XViewerAtsColumnIdColumn implements
//now check selected version
if (newVersion != null && newVersion.isVersionLocked()) {
String error = "Version \"" + newVersion.getCommitFullDisplayName() + "\" is locked or already released.";
- if (AtsUtilClient.isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(), "Change Version",
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !MessageDialog.openConfirm(Displays.getActiveShell(), "Change Version",
error + "\n\nOverride?")) {
return false;
- } else if (!AtsUtilClient.isAtsAdmin()) {
+ } else if (!AtsClientService.get().getUserService().isAtsAdmin()) {
AWorkbench.popup("ERROR", error);
}
}
@@ -194,8 +194,8 @@ public class TargetedVersionColumnUI extends XViewerAtsColumnIdColumn implements
}
}
- promptChangeVersion(awas, AtsUtilClient.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
- AtsUtilClient.isAtsAdmin() ? VersionLockedType.Both : VersionLockedType.UnLocked);
+ promptChangeVersion(awas, AtsClientService.get().getUserService().isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
+ AtsClientService.get().getUserService().isAtsAdmin() ? VersionLockedType.Both : VersionLockedType.UnLocked);
((XViewer) getXViewer()).update(awas.toArray(), null);
return;
} catch (OseeCoreException ex) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeOperationsSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeOperationsSection.java
index 0dfbc7bda8..949b9c285b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeOperationsSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeOperationsSection.java
@@ -182,7 +182,7 @@ public class WfeOperationsSection extends SectionPart {
}
private void createAdminSection(Composite parent, FormToolkit toolkit) {
- if (!AtsUtilClient.isAtsAdmin()) {
+ if (!AtsClientService.get().getUserService().isAtsAdmin()) {
return;
}
Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
@@ -228,7 +228,7 @@ public class WfeOperationsSection extends SectionPart {
if (editor.getAwa().getParentAWA() != null) {
new XButtonViaAction(new OpenParentAction(editor.getAwa())).createWidgets(sectionBody, 2);
}
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
new XButtonViaAction(new OpenInArtifactEditorAction(editor)).createWidgets(sectionBody, 2);
}
new XButtonViaAction(new ShowWorkDefinitionAction()).createWidgets(sectionBody, 2);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsSection.java
index 2a6d38918e..a87af7e1ae 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsSection.java
@@ -15,8 +15,8 @@ import java.util.List;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.RelationsFormSection;
@@ -45,7 +45,7 @@ public class WfeRelationsSection extends RelationsFormSection {
protected synchronized void createSection(Section section, FormToolkit toolkit) {
super.createSection(section, toolkit);
// Don't allow users to see all relations
- if (!AtsUtilClient.isAtsAdmin()) {
+ if (!AtsClientService.get().getUserService().isAtsAdmin()) {
getRelationComposite().getTreeViewer().addFilter(userRelationsFilter);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeTargetedVersionHeader.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeTargetedVersionHeader.java
index 1e3d96d672..39fea711d8 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeTargetedVersionHeader.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeTargetedVersionHeader.java
@@ -71,7 +71,7 @@ public class WfeTargetedVersionHeader extends Composite {
editor.doSave(null);
}
if (TargetedVersionColumnUI.promptChangeVersion(sma,
- AtsUtilClient.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
+ AtsClientService.get().getUserService().isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased,
VersionLockedType.UnLocked)) {
updateLabel(sma);
editor.onDirtied();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeWorkFlowTab.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeWorkFlowTab.java
index e082efbdda..5a51f35e8e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeWorkFlowTab.java
@@ -487,7 +487,7 @@ public class WfeWorkFlowTab extends FormPage implements IWorldViewerEventHandler
toolBarMgr.add(new AddNoteAction(awa, editor));
toolBarMgr.add(new OpenInAtsWorldAction(awa));
toolBarMgr.add(new OpenActionViewAction());
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
toolBarMgr.add(new OpenInArtifactEditorAction(editor));
}
toolBarMgr.add(new OpenVersionArtifactAction(awa));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WorkflowEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WorkflowEditor.java
index fa0e68141a..196ae30eba 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WorkflowEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WorkflowEditor.java
@@ -364,7 +364,7 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
private void createAttributesTab() {
try {
- if (!AtsUtilClient.isAtsAdmin()) {
+ if (!AtsClientService.get().getUserService().isAtsAdmin()) {
return;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
index 6247e9e332..acfd716327 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
@@ -296,7 +296,7 @@ public class ReviewInfoXWidget extends XLabelValueBase {
public void addAdminRightClickOption() throws OseeCoreException {
// If ATS Admin, allow right-click to auto-complete tasks
- if (AtsUtilClient.isAtsAdmin() && !AtsUtil.isProductionDb()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !AtsUtil.isProductionDb()) {
labelWidget.addListener(SWT.MouseUp, new Listener() {
@Override
public void handleEvent(Event event) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
index 5e05634450..dacfd775ab 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
@@ -135,7 +135,7 @@ public class TaskInfoXWidget extends XLabelValueBase {
public void addAdminRightClickOption() {
try {
// If ATS Admin, allow right-click to auto-complete tasks
- if (AtsUtilClient.isAtsAdmin() && !AtsUtil.isProductionDb()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !AtsUtil.isProductionDb()) {
labelWidget.addListener(SWT.MouseUp, new Listener() {
@Override
public void handleEvent(Event event) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/ATSPerspective.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/ATSPerspective.java
index ca1f5f3ee3..e0283155f7 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/ATSPerspective.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/ATSPerspective.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.ats.internal;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.navigate.NavigateView;
import org.eclipse.osee.ats.walker.ActionWalkerView;
import org.eclipse.osee.framework.ui.skynet.explorer.ArtifactExplorer;
@@ -64,7 +63,7 @@ public class ATSPerspective implements IPerspectiveFactory {
bottomLeft.addView(QuickSearchView.VIEW_ID);
right.addView(ArtifactExplorer.VIEW_ID);
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
bottom.addView("org.eclipse.pde.runtime.LogView");
}
bottom.addView(BranchView.VIEW_ID);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
index 835057758f..6127750991 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.activity.api.ActivityEntryId;
import org.eclipse.osee.activity.api.ActivityLog;
import org.eclipse.osee.ats.api.util.AtsActivity;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsActivityLogUtil;
import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.core.util.Result;
@@ -84,7 +84,7 @@ public class AtsNavigateComposite extends XNavigateComposite {
@Override
public void refresh() {
super.refresh();
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
for (XNavigateItem item : getInput()) {
if (item.getName().equals("Admin")) {
filteredTree.getViewer().expandToLevel(item, 1);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
index 8788ee2f01..af11316aac 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
@@ -196,7 +196,7 @@ public final class AtsNavigateViewItems implements XNavigateViewItems, IXNavigat
}
private void createAdminItems(XNavigateItem parent, List<XNavigateItem> items) throws OseeCoreException, OseeArgumentException {
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
XNavigateItem adminItems = new XNavigateItem(parent, "Admin", PluginUiImage.ADMIN);
XNavigateItem dbConvertItems = new XNavigateItem(adminItems, "Database Conversions", PluginUiImage.ADMIN);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
index bcd15286bb..4a5b7e0bb7 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
@@ -168,11 +168,11 @@ public class NavigateView extends ViewPart implements IXNavigateEventListener, I
public void refreshUserLabel() {
String str = getWhoAmI();
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
str += " - [Admin]";
}
if (!str.equals("")) {
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
userLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
} else {
userLabel.setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ToggleAtsAdmin.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ToggleAtsAdmin.java
index 624019ed8b..08f33b41ca 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ToggleAtsAdmin.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ToggleAtsAdmin.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ats.navigate;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.core.client.util.AtsGroup;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.editor.WorkflowEditor;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -48,7 +47,7 @@ public class ToggleAtsAdmin extends XNavigateItemAction {
AWorkbench.popup("Current User not configured for Temporary Admin");
return;
}
- boolean isAdmin = AtsUtilClient.isAtsAdmin(false);
+ boolean isAdmin = AtsClientService.get().getUserService().isAtsAdmin(false);
String message = "Currently " + (isAdmin ? "ADMIN" : "NOT ADMIN") + " - Toggle?";
if (MessageDialog.openConfirm(Displays.getActiveShell(), "Toggle ATS Admin", message)) {
@@ -59,7 +58,7 @@ public class ToggleAtsAdmin extends XNavigateItemAction {
AtsGroup.AtsAdmin.removeTemporaryOverride();
SystemGroup.OseeAdmin.addMember(AtsClientService.get().getUserServiceClient().getCurrentOseeUser());
}
- AtsUtilClient.isAtsAdmin(false);
+ AtsClientService.get().getUserService().isAtsAdmin(false);
AtsNavigateViewItems.getInstance().clearCaches();
for (WorkflowEditor editor : WorkflowEditor.getWorkflowEditors()) {
editor.refreshPages();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewNavigateView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewNavigateView.java
index 63f22932da..285cc19094 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewNavigateView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewNavigateView.java
@@ -123,11 +123,11 @@ public class ReviewNavigateView extends ViewPart implements IXNavigateEventListe
Label label = new Label(xNavComp, SWT.None);
String str = getWhoAmI();
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
str += " - Admin";
}
if (!str.equals("")) {
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
label.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
} else {
label.setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
index 5ef8b01296..11fd8b41fc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
@@ -84,7 +84,7 @@ public class AtsBranchCommitOperation extends AbstractOperation {
final Result tempResult = item.committing(teamArt);
if (tempResult.isFalse()) {
// Allow Admin to override state validation
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
Displays.pendInDisplayThread(new Runnable() {
@Override
public void run() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUserNavigateItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUserNavigateItems.java
index 793c1c437e..a10ca083fc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUserNavigateItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUserNavigateItems.java
@@ -14,8 +14,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.AtsImage;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.navigate.CreateNewUsersByNameItem;
import org.eclipse.osee.ats.navigate.SearchNavigateItem;
import org.eclipse.osee.ats.operation.PurgeUser;
@@ -37,7 +37,7 @@ public class AtsUserNavigateItems implements IUserNavigateItem {
@Override
public List<XNavigateItem> getNavigateItems(XNavigateItem parentItem) {
List<XNavigateItem> items = new ArrayList<>();
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
items.add(new XNavigateItemBlam(parentItem, new PurgeUser(), FrameworkImage.X_RED));
items.add(new XNavigateItemBlam(parentItem, new ReAssignATSObjectsToUser(), AtsImage.ACTION));
items.add(new CreateNewUsersByNameItem(parentItem));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PrivilegedUserManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PrivilegedUserManager.java
index fe8c174027..f27e0ae5a9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PrivilegedUserManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PrivilegedUserManager.java
@@ -45,7 +45,7 @@ public class PrivilegedUserManager {
if (parentSma != null) {
users.addAll(parentSma.getStateMgr().getAssignees());
}
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
users.add(AtsClientService.get().getUserService().getCurrentUser());
}
return users;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index 697d1de751..5a04a440d2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -140,7 +140,7 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
createTaskActionBar(tableComp);
labelWidget.setText(getLabel() + ": ");// If ATS Admin, allow right-click to auto-complete reviews
- if (AtsUtilClient.isAtsAdmin() && !AtsUtil.isProductionDb()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin() && !AtsUtil.isProductionDb()) {
labelWidget.addListener(SWT.MouseUp, new Listener() {
@Override
public void handleEvent(Event event) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
index db58756a58..7caa9be928 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
@@ -68,7 +68,7 @@ public class ReleaseVersionItem extends XNavigateItemAction {
IAtsVersion version = dialog.getSelectedFirst();
// Validate team lead status
- if (!AtsUtilClient.isAtsAdmin() && !AtsClientService.get().getVersionService().getTeamDefinition(
+ if (!AtsClientService.get().getUserService().isAtsAdmin() && !AtsClientService.get().getVersionService().getTeamDefinition(
version).getLeads().contains(AtsClientService.get().getUserService().getCurrentUser())) {
AWorkbench.popup("ERROR", "Only lead can release version.");
return;
@@ -85,7 +85,7 @@ public class ReleaseVersionItem extends XNavigateItemAction {
if (errorStr != null) {
AWorkbench.popup("ERROR", errorStr);
}
- if (errorStr != null && !AtsUtilClient.isAtsAdmin()) {
+ if (errorStr != null && !AtsClientService.get().getUserService().isAtsAdmin()) {
return;
} else if (errorStr != null && !MessageDialog.openConfirm(Displays.getActiveShell(), "Override",
"ATS Admin Enabled - Override completed condition and release anyway?")) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
index ec564dd1d3..559ed4e1e6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsRuleDefinitionDslRenderer.java
@@ -162,7 +162,7 @@ public final class AtsRuleDefinitionDslRenderer extends FileSystemRenderer {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- if (!AtsUtilClient.isAtsAdmin()) {
+ if (!AtsClientService.get().getUserService().isAtsAdmin()) {
AWorkbench.popup("Must be ATS Admin to make Rule Definition changes.");
return;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
index ea9230cec0..413d149ec3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslRenderer.java
@@ -164,7 +164,7 @@ public final class AtsWorkDefinitionDslRenderer extends FileSystemRenderer {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- if (!AtsUtilClient.isAtsAdmin()) {
+ if (!AtsClientService.get().getUserService().isAtsAdmin()) {
AWorkbench.popup("Must be ATS Admin to make Work Definition changes.");
return;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
index 8c94305299..810fa2f2ec 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -367,7 +367,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
updateEditMenuActions();
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
mm.insertBefore(XViewer.MENU_GROUP_PRE, deletePurgeAtsObjectAction);
deletePurgeAtsObjectAction.setEnabled(getSelectedAtsArtifacts().size() > 0);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
index 711c950c76..5bbe7cce94 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchUi.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.ats.world.search;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
@@ -52,7 +52,7 @@ public class MultipleIdSearchUi {
@Override
public void run() {
EntryDialog ed = null;
- if (AtsUtilClient.isAtsAdmin()) {
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
ed =
new EntryCheckDialog(data.getName(), "Enter Legacy ID, Guid or ID (comma separated)", "Include ArtIds");
} else {

Back to the top