Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8FF49A55 for ; Thu, 19 Apr 2012 17:49:55 +0000 (UTC) Received: (qmail 64415 invoked by uid 500); 19 Apr 2012 17:49:55 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 64366 invoked by uid 500); 19 Apr 2012 17:49:55 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 64358 invoked by uid 99); 19 Apr 2012 17:49:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 17:49:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gerhard.petracek@gmail.com designates 209.85.160.181 as permitted sender) Received: from [209.85.160.181] (HELO mail-gy0-f181.google.com) (209.85.160.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 17:49:48 +0000 Received: by ghbz13 with SMTP id z13so5020505ghb.12 for ; Thu, 19 Apr 2012 10:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=R3YXg5IPlNi+vPdsFwrN/djKukt+8OG9JWhKjQf0WIA=; b=OIOUkkDF7yVKwQMGpcDNF3nanIAXHBy4z74DM4cJVczFrH/bTDLbu1BCdeeMfKCIeY 1d6ShWPaMgiTT2bNgJMkUvhbOrFFP3r/UIiO3NfeEOLFnPqN2+0FoFt04PLBlliXCmlt E+kEu1AXoWCSdlai78upjxI1WMCKMT0cGlRQYYb2w2yRdgI8N47sCUPcBU31+OeZwmjm d4/ypDHjO+vYrG2my6MP065lG51k/E+4VO0uS2FmlButpxjPdoEMdrNMDK/+7RXjCUTy YmfzRzI6j3QydgUzzKRsy2n+YHeRLX42zpknsNH+6yuJzvSSIocvgaAEVbhN39m05xjl 87NQ== Received: by 10.236.184.102 with SMTP id r66mr2993022yhm.46.1334857767355; Thu, 19 Apr 2012 10:49:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.146.245.14 with HTTP; Thu, 19 Apr 2012 10:49:06 -0700 (PDT) In-Reply-To: References: From: Gerhard Petracek Date: Thu, 19 Apr 2012 19:49:06 +0200 Message-ID: Subject: Re: @Secured and Stereotypes To: MyFaces Discussion Content-Type: multipart/alternative; boundary=20cf3056409d0c84b504be0bcb64 --20cf3056409d0c84b504be0bcb64 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hi jose, here it works without an issue -> please provide the codi startup-log about the configuration you are using. @ package: please use: javax.enterprise.context regards, gerhard 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=E9 Luis Cetina > Thanks Gerhard, but i have a problem. > My checkpermision method never get called, i dont know why, i have this: > > *//ANOTATION* > @Stereotype > @Target(value =3D {ElementType.METHOD, ElementType.FIELD, ElementType.TYP= E}) > @Retention(value =3D RetentionPolicy.RUNTIME) > @Secured(PermissionAccessDecisionVoter.class) > public @interface ModuloPantallaBinding { > ModulosPantallasEnum codigoModulo(); > } > > *//MANAGED BEAN* > @Named > @ViewAccessScoped > @View(IInicio.SeleccionRoles.class) > > @ModuloPantallaBinding(codigoModulo=3DModulosPantallasEnum.SELECCION_ROLE= S_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 > violations) { > *ModuloPantallaBinding obj*=3D > 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=3D"seleccion_roles") class SeleccionRoles implements > IInicio{} > > it works but the obj always is null. > > Thanks > > > 2012/4/19 Gerhard Petracek > > > 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=E9 Luis Cetina > > > > > 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=E9 Luis Cetina* > > > ------------------------------------------------------------------- > > > > > > > > > -- > ------------------------------------------------------------------- > *SCJA. Jos=E9 Luis Cetina* > ------------------------------------------------------------------- > --20cf3056409d0c84b504be0bcb64--