
package de.ivu.elect.business.security;

import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

import de.ivu.elect.jee.security.AbstractSecureInterceptor;

@UseCaseSecure
@Interceptor
public class UseCaseSecureInterceptor extends AbstractSecureInterceptor<UseCasePermission, UseCaseSecure> {

  private static final long serialVersionUID = 1L;

  @Override
  @AroundInvoke
  public Object secure(InvocationContext ctx) throws Exception {
    return super.secure(ctx);
  }

  @Override
  protected Class<UseCaseSecure> getSecureAnnotationClass() {
    return UseCaseSecure.class;
  }

  @Override
  protected UseCasePermission getUseCasePermission(UseCaseSecure secure) {
    return secure.value();
  }

}
