Package org.openengsb.connector.serviceacl

Examples of org.openengsb.connector.serviceacl.ServicePermission


    @Test
    public void testCheckServiceAccess_shouldGrant() throws Exception {
        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod");

        userManager.addPermissionToUser("testuser", new ServicePermission(NullDomain.class.getName()));

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
    }
View Full Code Here


    @Test
    public void testCheckServiceAccessByName_shouldGrant() throws Exception {
        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod");

        userManager.addPermissionToUser("testuser", new ServicePermission("NULL"));

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
    }
View Full Code Here

    @Test
    public void testCheckMethodAccessByName_shouldGrant() throws Exception {
        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod", new Object());

        userManager.addPermissionToUser("testuser", new ServicePermission("NULL", "READ_NULL"));

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
    }
View Full Code Here

    @Test
    public void testCheckMethodAccessByWrongName_shouldDeny() throws Exception {
        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod", new Object());

        userManager.addPermissionToUser("testuser", new ServicePermission("NULL", "GET_NULL"));

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.ABSTAINED));
    }
View Full Code Here

    @Test
    public void testCheckMethodAccessByMethodName_shouldGrant() throws Exception {
        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod", new Object());

        userManager.addPermissionToUser("testuser", new ServicePermission("NULL", "nullMethod"));

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
    }
View Full Code Here

        NullDomainImpl nullDomainImpl = new NullDomainImpl("foo");
        MethodInvocation invocation = MethodInvocationUtils.create(nullDomainImpl, "nullMethod", new Object());

        attributeStore.putAttribute(nullDomainImpl, new SecurityAttributeEntry("name", "service.foo"));

        ServicePermission permission = new ServicePermission();
        permission.setInstance("service.foo");
        userManager.addPermissionToUser("testuser", permission);

        assertThat(accessControl.checkAccess("testuser", invocation), Matchers.is(Access.GRANTED));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.connector.serviceacl.ServicePermission

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.