Examples of MethodSecurityMetadataSource


Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

    @Bean
    public MethodSecurityMetadataSource methodSecurityMetadataSource() {
        List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
        ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
                getExpressionHandler());
        MethodSecurityMetadataSource customMethodSecurityMetadataSource = customMethodSecurityMetadataSource();
        if (customMethodSecurityMetadataSource != null) {
            sources.add(customMethodSecurityMetadataSource);
        }
        if (prePostEnabled()) {
            sources.add(new PrePostAnnotationSecurityMetadataSource(
View Full Code Here

Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

    public void testAdvisorReturnsFalseWhenMethodInvocationNotDefined() throws Exception {
        Class<TargetObject> clazz = TargetObject.class;
        Method method = clazz.getMethod("makeLowerCase", new Class[] {String.class});

        MethodSecurityMetadataSource mds = mock(MethodSecurityMetadataSource.class);
        when(mds.getAttributes(method, clazz)).thenReturn(null);
        MethodSecurityMetadataSourceAdvisor advisor = new MethodSecurityMetadataSourceAdvisor("", mds ,"");
        assertFalse(advisor.getPointcut().getMethodMatcher().matches(method, clazz));
    }
View Full Code Here

Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

    public void testAdvisorReturnsTrueWhenMethodInvocationIsDefined()
        throws Exception {
        Class<TargetObject> clazz = TargetObject.class;
        Method method = clazz.getMethod("countLength", new Class[] {String.class});

        MethodSecurityMetadataSource mds = mock(MethodSecurityMetadataSource.class);
        when(mds.getAttributes(method, clazz)).thenReturn(SecurityConfig.createList("ROLE_A"));
        MethodSecurityMetadataSourceAdvisor advisor = new MethodSecurityMetadataSourceAdvisor("", mds ,"");
        assertTrue(advisor.getPointcut().getMethodMatcher().matches(method, clazz));
    }
View Full Code Here

Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

        for (Map.Entry<String, String> entry : resourceMap.entrySet()) {
            methodMap.put(entry.getKey(), SecurityConfig
                    .createListFromCommaDelimitedString(entry.getValue()));
        }

        MethodSecurityMetadataSource source = new MapBasedMethodSecurityMetadataSource(
                methodMap);
        List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
        sources.add(source);

        List<MethodSecurityMetadataSource> methodSecurityMetadataSources = delegatingMethodSecurityMetadataSource
View Full Code Here

Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

        for (Map.Entry<String, String> entry : resourceMap.entrySet()) {
            methodMap.put(entry.getKey(), SecurityConfig
                    .createListFromCommaDelimitedString(entry.getValue()));
        }

        MethodSecurityMetadataSource source = new MapBasedMethodSecurityMetadataSource(
                methodMap);
        List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
        sources.add(source);

        List<MethodSecurityMetadataSource> methodSecurityMetadataSources = delegatingMethodSecurityMetadataSource
View Full Code Here

Examples of org.springframework.security.access.method.MethodSecurityMetadataSource

    @Bean
    public MethodSecurityMetadataSource methodSecurityMetadataSource() {
        List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
        ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
                methodExpressionHandler());
        MethodSecurityMetadataSource customMethodSecurityMetadataSource = customMethodSecurityMetadataSource();
        if (customMethodSecurityMetadataSource != null) {
            sources.add(customMethodSecurityMetadataSource);
        }
        if (prePostEnabled()) {
            sources.add(new PrePostAnnotationSecurityMetadataSource(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.