myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <maxtorz...@gmail.com>
Subject Re: @Secured and Stereotypes
Date Thu, 19 Apr 2012 16:08:14 GMT
Thanks Gerhard, but i have a problem.
My checkpermision method never get called, i dont know why, i have this:

*//ANOTATION*
@Stereotype
@Target(value = {ElementType.METHOD, ElementType.FIELD, ElementType.TYPE})
@Retention(value = RetentionPolicy.RUNTIME)
@Secured(PermissionAccessDecisionVoter.class)
public @interface ModuloPantallaBinding {
    ModulosPantallasEnum codigoModulo();
}

*//MANAGED BEAN*
@Named
@ViewAccessScoped
@View(IInicio.SeleccionRoles.class)
@ModuloPantallaBinding(codigoModulo=ModulosPantallasEnum.SELECCION_ROLES_INICIO)
public class SeleccionRolesMBean implements Serializable {
.
.
.
}

*//Secure class*
import javax.faces.bean.ApplicationScoped;
@ApplicationScoped
public class PermissionAccessDecisionVoter extends
AbstractAccessDecisionVoter implements AccessDecisionVoter{
.

protected void checkPermission(InvocationContext ic, Set<SecurityViolation>
violations) {
 *ModuloPantallaBinding obj*=
voterContext.getMetaDataFor(ModuloPantallaBinding.class.getName(),
ModuloPantallaBinding.class);


}
.
}


is correct the package javax.faces.bean.ApplicationScoped
for @ApplicationScoped or have to be:
javax.enterprise.context.ApplicationScoped;???

My checkPermission method never get called, but if i use the anottation
@Secure in my:
    @Secured(PermissionAccessDecisionVoter.class)
    public @Page(name="seleccion_roles") class SeleccionRoles implements
IInicio{}

it works but the obj  always is null.

Thanks


2012/4/19 Gerhard Petracek <gerhard.petracek@gmail.com>

> hi jose,
>
> see the description at [1] - it will be added to the wiki soon.
>
> regards,
> gerhard
>
> [1] https://issues.apache.org/jira/browse/EXTCDI-262
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2012/4/19 José Luis Cetina <maxtorzito@gmail.com>
>
> > Hello somebody know where i can find an example of
> > @Secured and Stereotypes
> >
> > Im triying to work with @Secured and Stereotypes with metadata but i have
> > some doubts
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
> >
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message