From richfaces-svn-commits at lists.jboss.org Mon Apr 13 13:56:33 2009 Content-Type: multipart/mixed; boundary="===============1537625739352992978==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r13542 - trunk/docs/userguide/en/src/main/docbook/modules. Date: Mon, 13 Apr 2009 13:56:33 -0400 Message-ID: --===============1537625739352992978== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: msorokin Date: 2009-04-13 13:56:33 -0400 (Mon, 13 Apr 2009) New Revision: 13542 Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml Log: https://jira.jboss.org/jira/browse/RF-6557 rich:isUserInRole(Object) function is documented Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2= 009-04-13 17:29:53 UTC (rev 13541) +++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2= 009-04-13 17:56:33 UTC (rev 13542) @@ -3766,4 +3766,24 @@ url=3D"http://livedemo.exadel.com/richfaces-demo/richfaces/stateAPI.js= f?c=3DstateAPI" >here. + +
+ Identifing User Roles + = + RichFaces provides a function to check whether the logged-in user = belongs to a certain user role. The function is = rich:isUserInRole(Object), it takes a String, a comma-separated lis= t String, Collection etc. as arguments and returns a boolean value. + + For example, you need to render some controls only for administrat= ors. + To do this you need to create a role "admin" in web.xml and = implement authorisation that assigns the "admin" role to the user= that loggged-in as an administrator. Afterwards, you can use the ric= h:isUserInRole(Object) function with the "r= endered" attribute of any component. + = + + Example: + + +...]]> = + = + In the example above only a logged-in user with the role "adm= in" can see the text editor while for the user with other roles the c= omponent will not be rendered. + = +
+ = --===============1537625739352992978==--