I want to secure my "Stateless" EJb with the DeltaSpike-API.
@Stateless
@Remote(UserServiceRemote.class)
public class UserService implements UserServiceRemote
At method level i have a custom annotation "Support"
@Support
public void doSomething() {}
Therefore i wrote a custom annotation "@Support":
@Retention(value = RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD })
@Documented
@SecurityBindingType
public @interface Support {
My custom Authorizer looks like:
@Secures
@Support
public boolean doAdminCheck(Identity identity, IdentityManager identityManager, RelationshipManager relationshipManager)
throws Exception {
return hasRole(relationshipManager, identity.getAccount(), getRole(identityManager, "Support"));
}
In my "beans.xml" file i included:
<interceptors>
<class>org.apache.deltaspike.security.impl.extension.SecurityInterceptor</class>
</interceptors>
But after i log in my application and call the "doSomething" method per remote call the "Support" annotation is ignored, no matter if I have the role or not.
What I'm doing wrong? Thanx for all suggestions!!!