Is there a way to retrieve the equivalent to jiuser.id from the authentication.principal object? What I am looking for is something that would be similar to how authentication.getPrincipal().getUserName() = jiuser.username, or authentication.getPrincipal().getTenantId() = jiuser.tenantId. I am working with JasperReports Server 4.0 Professional, trying to use row-based security in a domain to restrict views to data for sites to which a user has access. The filter uses the following tables: tl_site - Information on the sites, with site_id as primary key vr_user_sites - a table that matches assigned tl_site.id site values to the appropriate users' jiuser.id values. My filterExpression in the security XML file is as follows: tl_site.site_id in (assigned_sites()) assigned_sites is entered in the map for the "functionTemplates" property of the "defaultSQLGenerator" bean as follows: <entry key="assigned_sites"> <value> "select site_id from vr_user_sites where user_id =" + groovy((new Integer(authentication.getPrincipal().getId())).toString()) </value> </entry> I got a RuntimeException when attempting to run a report with a user to whom this filter is applied, with the final cause shown in the log as follows: Caused by: groovy.lang.MissingMethodException: No signature of method: com.jaspersoft.jasperserver.api.metadata.user.domain.impl.client.MetadataUserDetails.getId() is applicable for argument types: () values: []Possible solutions: getAt(java.lang.String), wait(), wait(long), grep(java.lang.Object), find(groovy.lang.Closure), each(groovy.lang.Closure) I got a similar error, but for a nonexistent field, when replacing "getId()" above with "id". So, is it possible to get the value for jiuser.id from the authentication.principal object, or should the vr_user_sites table be modified to include the jiuser.username and jiuser.tenantId values as well, and then match against these? Thanks much!