Hi,
I have a javaconfig file that is working fine.
i debug my application in loading time and i see that the parameter is been transfered.
inside BrandsApi I have a method with @Secured({ "ROLE_ADMIN" }) above itCode:@Configuration public class SpringJavaConfig { @Bean public BrandsApi brandsApi(){ return new BrandsApi(); } }
this is how i call the method:
but for some reason i can get inside even though I have logged in ROLE_EMPLOYEECode:ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringJavaConfig.class); BrandsApi brandsApi = (BrandsApi)ctx.getBean(BrandsApi.class); brandsApi.getAll();
this is my BrandsApi class:
Attached my xml's config.Code:class BrandsApi extends BaseApi{ @Secured({ "ROLE_ADMIN" }) public void getAll() { System.out.println("Hello"); } }
Thanks!


Reply With Quote
