Package gov.nasa.arc.mct.components.collection

Examples of gov.nasa.arc.mct.components.collection.Group


        // Otherwise, check for a match on owner
        // Finally, check if there is Group ownership of this component
        User user = PlatformAccess.getPlatform().getCurrentUser();
        String owner = component.getOwner();
        if (!owner.equals("*") && !owner.equals(user.getUserId()) && !RoleAccess.hasRole(user, owner)) {
            Group group = component.getCapability(Group.class); // Check for group ownership
            String groupId = group != null ? group.getDiscipline() : null;
            if (groupId == null || !groupId.equals(PlatformAccess.getPlatform().getCurrentUser().getDisciplineId())) {
                return new ExecutionResult(context, false, "User does not own this component.");
            }
        }
           
View Full Code Here


     * Verifies that the component exhibits a Group capability,
     * and furthermore that its group matches what is set using persistence.
     */
    @Test
    public void testGroup() {
        Group group = testComponent.getCapability(Group.class);
        Assert.assertNotNull(group);
        Assert.assertNotNull(group.getDiscipline());
       
        testComponent.getCapability(ModelStatePersistence.class).setModelState("test");
        Assert.assertEquals(group.getDiscipline(), "test");
        Assert.assertEquals(testComponent.getCapability(Group.class).getDiscipline(), "test");
       
        testComponent.getCapability(ModelStatePersistence.class).setModelState("retest");
        Assert.assertEquals(group.getDiscipline(), "retest");
        Assert.assertEquals(testComponent.getCapability(Group.class).getDiscipline(), "retest");       
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.collection.Group

Copyright © 2018 www.massapicom. 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.