use of gov.ca.cwds.security.module.SecurityModule in project perry by ca-cwds.
the class TestModule method configure.
@Override
protected void configure() {
bind(TestService.class).to(TestServiceImpl.class);
install(new SecurityModule(null).addAuthorizer("case:read", CaseAuthorizer.class).addStaticAuthorizer(TestStaticAuthorizer.class));
bindInterceptor(Matchers.any(), Matchers.any(), new MethodInterceptor() {
PermissionAnnotationMethodInterceptor permissionAnnotationMethodInterceptor = new PermissionAnnotationMethodInterceptor();
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
return permissionAnnotationMethodInterceptor.invoke(new org.apache.shiro.aop.MethodInvocation() {
@Override
public Object proceed() throws Throwable {
return invocation.proceed();
}
@Override
public Method getMethod() {
return invocation.getMethod();
}
@Override
public Object[] getArguments() {
return invocation.getArguments();
}
@Override
public Object getThis() {
return invocation.getThis();
}
});
}
});
}
use of gov.ca.cwds.security.module.SecurityModule in project cals-api by ca-cwds.
the class CalsApiApplication method applicationModule.
@Override
public Module applicationModule(Bootstrap<CalsApiConfiguration> bootstrap) {
return new ApplicationModule<CalsApiConfiguration>(bootstrap) {
@Override
protected void configure() {
super.configure();
install(new DataAccessModule(bootstrap) {
@Provides
UnitOfWorkAwareProxyFactory provideUnitOfWorkAwareProxyFactory() {
return new UnitOfWorkAwareProxyFactory(getLisHibernateBundle(), getFasHibernateBundle(), getCmsHibernateBundle(), getCalsnsHibernateBundle(), getXaCmsHibernateBundle(), getXaCalsnsHibernateBundle());
}
});
install(new SecurityModule(BaseApiApplication::getInjector).addAuthorizer(Authorize.PLACEMENT_HOME_CREATE, PlacementHomeCreateAuthorizer.class).addAuthorizer(Authorize.SUBSTITUTE_CARE_PROVIDER_CREATE, SubstituteCareProviderCreateAuthorizer.class).addAuthorizer(CLIENT_RESULT_READ, ClientResultReadAuthorizer.class).addStaticAuthorizer(FacilityReadStaticAuthorizer.class));
}
};
}
Aggregations