Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2016-10-12 17:22:51 -0400
committerMorgan E. Cook2016-10-13 15:32:44 -0400
commit931bd9d908196907979a636296112772aa7e2725 (patch)
treec07c27b16d96b00012d6118047acec2632abfd39
parent2b523ff97a34059a6cb625bf255cd1d2ee28a97f (diff)
downloadorg.eclipse.osee-0.24.2.tar.gz
org.eclipse.osee-0.24.2.tar.xz
org.eclipse.osee-0.24.2.zip
bug[ats_ATS317936]: Fix users able to edit baseline branches0.24.2.v201610181545_RELbuild_attempt0.24.2
Change-Id: Iead30965f2c1216c42c9d8b749542987a6511596 Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java7
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java7
-rw-r--r--plugins/org.eclipse.osee.client.demo/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AbstractAddRequirementsBranch.java7
-rw-r--r--plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddRequirementData.java6
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java9
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java7
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/RelationIntegrityCheckTest.java6
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java9
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java32
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java21
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java2
15 files changed, 103 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
index 9ae6948d1f8..d75ac11dfda 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
@@ -48,6 +48,7 @@ Import-Package: javax.ws.rs.core;version="2.0.0",
org.eclipse.osee.ats.world.search,
org.eclipse.osee.define.traceability,
org.eclipse.osee.define.traceability.data,
+ org.eclipse.osee.framework.access,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
index d33439edd85..188f9416862 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
@@ -51,16 +51,19 @@ import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.core.workflow.transition.TeamWorkFlowManager;
import org.eclipse.osee.ats.demo.api.DemoArtifactToken;
import org.eclipse.osee.ats.demo.api.DemoArtifactTypes;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.FavoritesManager;
import org.eclipse.osee.ats.util.SubscribeManagerUI;
import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
@@ -69,6 +72,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -249,6 +253,9 @@ public class PopulateDemoActions extends XNavigateItemAction {
// Create SAW_Bld_2 branch off SAW_Bld_1
BranchId childBranch = BranchManager.createBaselineBranch(SAW_Bld_1, SAW_Bld_2);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), SAW_Bld_2,
+ PermissionEnum.FULLACCESS);
+
DemoDbUtil.sleep(5000);
// need to update the branch type;
ConnectionHandler.runPreparedUpdate(UPDATE_BRANCH_TYPE,
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
index 691822015c5..ba0ad204564 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
@@ -36,8 +36,10 @@ import org.eclipse.osee.ats.demo.api.DemoProgram;
import org.eclipse.osee.ats.demo.api.DemoSubsystems;
import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.framework.core.data.IArtifactToken;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -75,6 +77,11 @@ public class DemoDatabaseConfig implements IDbInitializationTask {
AtsGroup.AtsTempAdmin.addMember(UserManager.getUser(DemoUsers.Joe_Smith));
AtsGroup.AtsTempAdmin.getArtifact().persist("Set Joe as Temp Admin");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), SAW_Bld_1,
+ PermissionEnum.FULLACCESS);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), CIS_Bld_1,
+ PermissionEnum.FULLACCESS);
+
AtsDatabaseConfig.organizePrograms(AtsArtifactTypes.Program, DemoArtifactToken.DemoPrograms);
createUsgCountryConfig();
diff --git a/plugins/org.eclipse.osee.client.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.client.demo/META-INF/MANIFEST.MF
index 22c9d829d55..d7d8c53e88e 100644
--- a/plugins/org.eclipse.osee.client.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.client.demo/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Import-Package: org.eclipse.core.filesystem,
org.eclipse.osee.ats.demo.api,
org.eclipse.osee.define.traceability,
org.eclipse.osee.define.traceability.data,
+ org.eclipse.osee.framework.access,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
diff --git a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AbstractAddRequirementsBranch.java b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AbstractAddRequirementsBranch.java
index 1b21822d47b..96c21584de6 100644
--- a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AbstractAddRequirementsBranch.java
+++ b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AbstractAddRequirementsBranch.java
@@ -10,13 +10,17 @@
*******************************************************************************/
package org.eclipse.osee.client.demo.internal;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.client.demo.DemoSubsystems;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -37,6 +41,9 @@ public abstract class AbstractAddRequirementsBranch implements IDbInitialization
public void run() throws OseeCoreException {
BranchId requirementsBranch = BranchManager.createTopLevelBranch(branch);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), requirementsBranch,
+ PermissionEnum.FULLACCESS);
+
Artifact sawProduct =
ArtifactTypeManager.addArtifact(CoreArtifactTypes.Component, requirementsBranch, "SAW Product Decomposition");
diff --git a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddRequirementData.java b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddRequirementData.java
index 602c7985493..cedcc2b0cb5 100644
--- a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddRequirementData.java
+++ b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddRequirementData.java
@@ -20,12 +20,15 @@ import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
@@ -33,6 +36,7 @@ import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -86,6 +90,8 @@ public class AddRequirementData implements IDbInitializationTask {
}
// Create SAW_Bld_2 branch off SAW_Bld_1
BranchId childBranch = BranchManager.createBaselineBranch(SAW_Bld_1, SAW_Bld_2);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), SAW_Bld_2,
+ PermissionEnum.FULLACCESS);
sleep(5000);
// need to update the branch type;
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java
index 5b797e06a53..5b685f7142b 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java
@@ -22,9 +22,11 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionToken;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -32,6 +34,7 @@ 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.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.model.cache.BranchFilter;
@@ -39,6 +42,7 @@ import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.MatchLocation;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -179,6 +183,8 @@ public class ArtifactQueryTest {
public void testGetOrCreate() throws Exception {
String guid = GUID.create();
BranchId branch = BranchManager.createTopLevelBranch(testInfo.getTestName() + " branch");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), branch, PermissionEnum.FULLACCESS);
+
Artifact artifact1 = ArtifactQuery.getOrCreate(guid, CoreArtifactTypes.GeneralData, branch);
Assert.assertNotNull(artifact1);
Artifact artifact2 = ArtifactQuery.getOrCreate(guid, CoreArtifactTypes.GeneralData, branch);
@@ -191,6 +197,8 @@ public class ArtifactQueryTest {
public void testLargeAttributeIndexing() throws Exception {
String guid = GUID.create();
BranchId branch = BranchManager.createTopLevelBranch(testInfo.getTestName() + " branch");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), branch, PermissionEnum.FULLACCESS);
+
Artifact artifact1 = ArtifactQuery.getOrCreate(guid, CoreArtifactTypes.GeneralData, branch);
artifact1.setSoleAttributeFromString(CoreAttributeTypes.Name, longStr());
artifact1.persist(testInfo.getTestName());
@@ -206,6 +214,7 @@ public class ArtifactQueryTest {
@Test
public void testQueryById() throws OseeCoreException {
BranchId branch = BranchManager.createTopLevelBranch(testInfo.getTestName() + " branch");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), branch, PermissionEnum.FULLACCESS);
List<Integer> newIdsInOrder = new LinkedList<>();
Map<Integer, TransactionToken> idToTxId = new HashMap<>();
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
index 39ff589a64b..a266ab20822 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/HtmlRendererTest.java
@@ -15,16 +15,20 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -79,6 +83,9 @@ public class HtmlRendererTest {
String branchName = method.getQualifiedTestName();
rootBranch = BranchManager.createTopLevelBranch(branchName);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), rootBranch,
+ PermissionEnum.FULLACCESS);
+
Artifact programRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(rootBranch);
Folder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, rootBranch, "Folder");
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/RelationIntegrityCheckTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/RelationIntegrityCheckTest.java
index 178901fff02..ff6063f5028 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/RelationIntegrityCheckTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/RelationIntegrityCheckTest.java
@@ -13,15 +13,19 @@ package org.eclipse.osee.client.integration.tests.integration.ui.skynet;
import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.type.DoubleKeyHashMap;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -63,6 +67,8 @@ public class RelationIntegrityCheckTest {
@Before
public void setUp() throws Exception {
parentBranch = BranchManager.createTopLevelBranch("1");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), parentBranch,
+ PermissionEnum.FULLACCESS);
Artifact art_A = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, parentBranch, "A");
art_A.persist(getClass().getSimpleName());
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
index 30f309d92fa..b7bf5ae9e18 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/WordTemplateRendererTest.java
@@ -18,14 +18,16 @@ import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -162,6 +164,9 @@ public class WordTemplateRendererTest {
String branchName = method.getQualifiedTestName();
rootBranch = BranchManager.createTopLevelBranch(branchName);
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), rootBranch,
+ PermissionEnum.FULLACCESS);
+
Artifact programRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(rootBranch);
templateFolder = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, rootBranch, "Templates");
@@ -199,6 +204,8 @@ public class WordTemplateRendererTest {
@Test
public void testBlankWordTemplateContent() {
BranchId rootBr = BranchManager.createTopLevelBranch("Root Branch");
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), rootBr, PermissionEnum.FULLACCESS);
+
SkynetTransaction tx =
TransactionManager.createTransaction(rootBr, String.format("%s", method.getQualifiedTestName()));
Artifact vol4 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.HeadingMSWord, rootBr, "Volume 4");
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
index facf002f229..7d829d7bb5b 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
@@ -64,6 +64,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.SystemGroup;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.OseeEventService;
@@ -334,7 +335,8 @@ public class AccessControlService implements IAccessControlService {
if (o instanceof BranchId) {
key.add(String.valueOf(((BranchId) o).getGuid()));
} else if (o instanceof Artifact) {
- key.add(((Artifact) o).getGuid() + ((Artifact) o).getBranchId());
+ key.add(((Artifact) o).getGuid());
+ key.add(String.valueOf(((Artifact) o).getBranch().getGuid()));
} else {
key.add(GUID.create());
}
@@ -386,7 +388,10 @@ public class AccessControlService implements IAccessControlService {
PermissionEnum userPermission = null;
AccessObject accessObject = BranchAccessObject.getBranchAccessObjectFromCache(branch);
- if (accessObject == null) {
+ if (accessObject == null && (!CoreBranches.COMMON.getId().equals(branch.getId()) && BranchManager.getType(
+ branch).isBaselineBranch())) {
+ userPermission = PermissionEnum.READ;
+ } else if (accessObject == null) {
userPermission = PermissionEnum.FULLACCESS;
} else {
userPermission = acquirePermissionRank(subject, accessObject);
@@ -430,13 +435,9 @@ public class AccessControlService implements IAccessControlService {
private PermissionEnum acquirePermissionRank(IBasicArtifact<?> subject, AccessObject accessObject) {
ensurePopulated();
- PermissionEnum userPermission = PermissionEnum.FULLACCESS;
int subjectId = subject.getArtId();
- userPermission = accessControlListCache.get(subjectId, accessObject);
- if (userPermission == null) {
- userPermission = PermissionEnum.FULLACCESS;
- }
+ PermissionEnum userPermission = accessControlListCache.get(subjectId, accessObject);
if (subjectToGroupCache.containsKey(subjectId)) {
for (int groupPermissionId : subjectToGroupCache.getValues(subjectId)) {
@@ -445,18 +446,21 @@ public class AccessControlService implements IAccessControlService {
if (groupPermission != null) {
if (userPermission == null) {
userPermission = groupPermission;
- }
-
- if (groupPermission.getRank() > userPermission.getRank()) {
+ } else if (groupPermission.getRank() > userPermission.getRank()) {
userPermission = groupPermission;
}
}
-
- if (userPermission == null) {
- userPermission = PermissionEnum.DENY;
- }
}
}
+ if (userPermission == null) {
+ if (!CoreBranches.COMMON.getId().equals(accessObject.getBranchId()) && BranchManager.getType(
+ BranchId.valueOf(accessObject.getBranchId())).isBaselineBranch()) {
+ userPermission = PermissionEnum.READ;
+ } else {
+ userPermission = PermissionEnum.FULLACCESS;
+ }
+ }
+
return userPermission;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
index bf4549f6717..672fc79e89c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
@@ -63,6 +63,7 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.nebula.widgets.xviewer.util,
org.eclipse.osee.account.rest.client,
org.eclipse.osee.account.rest.model,
+ org.eclipse.osee.ats.demo.api,
org.eclipse.osee.define.report.api,
org.eclipse.osee.framework.access,
org.eclipse.osee.framework.access.internal.data,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java
index 52b2179132b..6c78e693196 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionToken;
@@ -26,6 +27,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
@@ -67,6 +69,8 @@ public class BranchCreationHandler extends CommandHandler {
BranchId branch = parentTransactionId.getBranch();
if (branch.equals(CoreBranches.SYSTEM_ROOT)) {
BranchManager.createTopLevelBranch(dialog.getEntry());
+ AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), branch,
+ PermissionEnum.FULLACCESS);
} else {
if (dialog.isChecked()) {
BranchManager.createWorkingBranchFromTx(parentTransactionId, dialog.getEntry(), null);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java
index 83a7b6ad0a3..b31b7fb5d17 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java
@@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -57,14 +58,32 @@ public abstract class GeneralBranchHandler extends CommandHandler {
Iterator<IOseeBranch> iterator = selectedBranches.iterator();
List<BranchId> hasChildren = new LinkedList<>();
+ List<BranchId> hasNoPermission = new LinkedList<>();
while (iterator.hasNext()) {
BranchId branch = iterator.next();
- if (BranchManager.hasChildren(branch)) {
+ boolean removed = false;
+ if (!AccessControlManager.hasPermission(branch, PermissionEnum.WRITE)) {
iterator.remove();
+ hasNoPermission.add(branch);
+ removed = true;
+ }
+ if (BranchManager.hasChildren(branch)) {
+ if (!removed) {
+ iterator.remove();
+ }
hasChildren.add(branch);
}
}
+ if (!hasNoPermission.isEmpty()) {
+ StringBuilder noPermission = new StringBuilder();
+ noPermission.append(String.format(
+ "User does not have permission on the following branches and cannot be %sd:\n", type.dialogType));
+ noPermission.append(String.format("%s", hasNoPermission.toString()));
+
+ MessageDialog.openError(Displays.getActiveShell(), type.dialogTitle, noPermission.toString());
+ }
+
if (!hasChildren.isEmpty()) {
StringBuilder children = new StringBuilder();
children.append(String.format("The following branches have children and cannot be %sd:\n", type.dialogType));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
index 6ca4dfaf38a..f96f0e45a65 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenu.java
@@ -115,7 +115,7 @@ public class GlobalMenu {
}
if (purgeMenuItem != null) {
purgeMenuItem.setEnabled(
- !artifacts.isEmpty() && permiss.isHasArtifacts() && AccessControlManager.isOseeAdmin());
+ !artifacts.isEmpty() && permiss.isHasArtifacts() && permiss.isWritePermission() && AccessControlManager.isOseeAdmin());
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);

Back to the top