Hi,
i'm trying to apply the DS (1.0.0) security example (Wildfly 8.1.0,
weld, MyFaces 2.0.18) to the JSF module, specifically the @Secured and
Stereotypes with custom Meta-data.
So, i did create:
@Stereotype
@Secured(RoleAccessDecisionVoter.class)
public @interface Admin
{
int securityLevel();
}
When i use that annotation on a bean everything works fine:
public class RoleAccessDecisionVoter implements AccessDecisionVoter
{
private static final long serialVersionUID = -8007511215776345835L;
public Set<SecurityViolation> checkPermission(AccessDecisionVoterContext
voterContext)
{
Admin admin = voterContext.getMetaDataFor(Admin.class.getName(),
Admin.class);
does work, and will return the securitylevel from the bean.
But, when i use the annotation in the JSF views, the @Secured is working, but
the Annotation is not
found in the voterContext.
public interface Pages {
class Index implements ViewConfig { }
@Admin(securityLevel=42)
class Admin implements ViewConfig { }
}
in this case "admin" in the checkPermission is null ...
Am i missing something obvious? Is it supposed to work this way?
Kind regards,
Michael