You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Alessandro Polverini (JIRA)" <in...@incubator.apache.org> on 2005/03/03 16:05:54 UTC

[jira] Created: (MYFACES-114) visibleOnUserRole not working

visibleOnUserRole not working
-----------------------------

         Key: MYFACES-114
         URL: http://issues.apache.org/jira/browse/MYFACES-114
     Project: MyFaces
        Type: Bug
    Versions: Nightly Build    
 Environment: tomcat 5.0.28, JDK 1.5.0_01
    Reporter: Alessandro Polverini


I made what I think could be the smallest test, and that is the source
of the page:

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
<html><body>
<f:view>
    <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
    servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
</f:view>
</body></html>

And the output is:

MyFaces says current user has role dummy
servlet says current user has role dummy: false

So I think something is wrong in myfaces implementation since request.isUserInRole() return false but outputText is showing the text anyway.
I'm using tomcat 5.0.28 with JDBC realm and authentication it's running fine for the other aspects.

Also, would it be best to name the attribute "renderedOnUserRole" to be more consistent with standard JSF attributes?

Thanks,
Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (MYFACES-114) visibleOnUserRole not working

Posted by Manfred Geiler <ma...@gmail.com>.
ok, added jira permission, so that reporters can close their issues in
the future
-M

On 4/13/05, Alessandro Polverini (JIRA)
<my...@incubator.apache.org> wrote:
>      [ http://issues.apache.org/jira/browse/MYFACES-114?page=comments#action_62706 ]
> 
> Alessandro Polverini commented on MYFACES-114:
> ----------------------------------------------
> 
> This works fine on myfaces 1.0.9-rc3, probably I was using a bad release (rebuilt from CVS).
> 
> Please someone close the bug, it seems I can't even close my opened bugs.
> 
> Alex
> 
> > visibleOnUserRole not working
> > -----------------------------
> >
> >          Key: MYFACES-114
> >          URL: http://issues.apache.org/jira/browse/MYFACES-114
> >      Project: MyFaces
> >         Type: Bug
> >     Versions: Nightly Build
> >  Environment: tomcat 5.0.28, JDK 1.5.0_01
> >     Reporter: Alessandro Polverini
> 
> >
> > I made what I think could be the smallest test, and that is the source
> > of the page:
> > <%@page contentType="text/html"%>
> > <%@page pageEncoding="UTF-8"%>
> > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> > <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> > <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
> > <html><body>
> > <f:view>
> >     <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
> >     servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
> > </f:view>
> > </body></html>
> > And the output is:
> > MyFaces says current user has role dummy
> > servlet says current user has role dummy: false
> > So I think something is wrong in myfaces implementation since request.isUserInRole() return false but outputText is showing the text anyway.
> > I'm using tomcat 5.0.28 with JDBC realm and authentication it's running fine for the other aspects.
> > Also, would it be best to name the attribute "renderedOnUserRole" to be more consistent with standard JSF attributes?
> > Thanks,
> > Alex
> 
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> If you want more information on JIRA, or have a bug to report see:
>    http://www.atlassian.com/software/jira
> 
>

[jira] Commented: (MYFACES-114) visibleOnUserRole not working

Posted by "Manfred Geiler (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-114?page=comments#action_61944 ]
     
Manfred Geiler commented on MYFACES-114:
----------------------------------------

It works for me, perhaps a Tomcat 5.0.28 issue?
Do you have special ServletFilters or something like that?
Could you please try the enabledOnUserRole attribute, too?

I tell you, the only thing we do is call the facesContext.getExternalContext().isUserInRole() method. Have a look at org.apache.myfaces.component.UserRoleUtils

> Also, would it be best to name the attribute "renderedOnUserRole" to
> be more consistent with standard JSF attributes?
Yes.
Historical: visibleOnUserRole already existed when there was no rendered attribute specified yet. ;-)
But for backwards compatibility we should rather leave visibleOnUserRole and mark it deprecated.

-M

> visibleOnUserRole not working
> -----------------------------
>
>          Key: MYFACES-114
>          URL: http://issues.apache.org/jira/browse/MYFACES-114
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>  Environment: tomcat 5.0.28, JDK 1.5.0_01
>     Reporter: Alessandro Polverini

>
> I made what I think could be the smallest test, and that is the source
> of the page:
> <%@page contentType="text/html"%>
> <%@page pageEncoding="UTF-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
> <html><body>
> <f:view>
>     <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
>     servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
> </f:view>
> </body></html>
> And the output is:
> MyFaces says current user has role dummy
> servlet says current user has role dummy: false
> So I think something is wrong in myfaces implementation since request.isUserInRole() return false but outputText is showing the text anyway.
> I'm using tomcat 5.0.28 with JDBC realm and authentication it's running fine for the other aspects.
> Also, would it be best to name the attribute "renderedOnUserRole" to be more consistent with standard JSF attributes?
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-114) visibleOnUserRole not working

Posted by "Alessandro Polverini (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-114?page=comments#action_62706 ]
     
Alessandro Polverini commented on MYFACES-114:
----------------------------------------------

This works fine on myfaces 1.0.9-rc3, probably I was using a bad release (rebuilt from CVS).

Please someone close the bug, it seems I can't even close my opened bugs.

Alex

> visibleOnUserRole not working
> -----------------------------
>
>          Key: MYFACES-114
>          URL: http://issues.apache.org/jira/browse/MYFACES-114
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>  Environment: tomcat 5.0.28, JDK 1.5.0_01
>     Reporter: Alessandro Polverini

>
> I made what I think could be the smallest test, and that is the source
> of the page:
> <%@page contentType="text/html"%>
> <%@page pageEncoding="UTF-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
> <html><body>
> <f:view>
>     <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
>     servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
> </f:view>
> </body></html>
> And the output is:
> MyFaces says current user has role dummy
> servlet says current user has role dummy: false
> So I think something is wrong in myfaces implementation since request.isUserInRole() return false but outputText is showing the text anyway.
> I'm using tomcat 5.0.28 with JDBC realm and authentication it's running fine for the other aspects.
> Also, would it be best to name the attribute "renderedOnUserRole" to be more consistent with standard JSF attributes?
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (MYFACES-114) visibleOnUserRole not working

Posted by "Manfred Geiler (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-114?page=history ]
     
Manfred Geiler resolved MYFACES-114:
------------------------------------

    Resolution: Cannot Reproduce

> visibleOnUserRole not working
> -----------------------------
>
>          Key: MYFACES-114
>          URL: http://issues.apache.org/jira/browse/MYFACES-114
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>  Environment: tomcat 5.0.28, JDK 1.5.0_01
>     Reporter: Alessandro Polverini

>
> I made what I think could be the smallest test, and that is the source
> of the page:
> <%@page contentType="text/html"%>
> <%@page pageEncoding="UTF-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
> <html><body>
> <f:view>
>     <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
>     servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
> </f:view>
> </body></html>
> And the output is:
> MyFaces says current user has role dummy
> servlet says current user has role dummy: false
> So I think something is wrong in myfaces implementation since request.isUserInRole() return false but outputText is showing the text anyway.
> I'm using tomcat 5.0.28 with JDBC realm and authentication it's running fine for the other aspects.
> Also, would it be best to name the attribute "renderedOnUserRole" to be more consistent with standard JSF attributes?
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira