Search code examples
javasecurityrichfacesseamfiltering

How to filter a richfaces dataTable according to user role


I am working on a Seam project (Seam 2) with two types of user roles. Normal users, and users with sensitive information privileges. The latter have access to a set of database records marked "sensitive" that coexist with normal records, and are marked by a particular column value.

I have used #{s:hasRole('SENSITIVE')} to hide other portions of the UI as appropriate, but I would like to filter the actual richfaces dataTable in which the records are displayed, so that sensitive records do not appear for normal users. Is there a way to do this at the presentation layer, or do I need to filter the rows on the server based on user role?


Solution

  • Did you try the filter related properties in DataTable. please look at the properties their:

    http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=info&cid=147