2.17.2: 2011-06-17

net.sf.basedb.core
Class QueryRuntimeFilterFactory.ChildFilter

java.lang.Object
  extended by net.sf.basedb.core.QueryRuntimeFilterFactory.ChildFilter
All Implemented Interfaces:
QueryRuntimeFilter
Enclosing class:
QueryRuntimeFilterFactory

static class QueryRuntimeFilterFactory.ChildFilter
extends Object
implements QueryRuntimeFilter

An optional filter that can be used by BasicItem:s to replace the QueryRuntimeFilterFactory.BasicFilter. This filter checks if the logged in user has generic permission EntityQuery.getItemPermission() for a parent item, instead of the actual item returned by a query. In a parent/child relationship it is the permissions on the parent item that controls the permission on the child. For example, Client is the parent of Help.

If the logged in user doesn't have the requested permission on the parent item, the denyAll filter is enabled.


Field Summary
private  Item child
          The item type of the child item.
private  Item parent
          The item type of the parent item.
 
Constructor Summary
QueryRuntimeFilterFactory.ChildFilter(Item child, Item parent)
          Create a new ChildFilter object.
 
Method Summary
 void enableFilters(QueryRuntimeFilterManager manager, EntityQuery query, DbControl dc)
          Enable the filters based on the options specified by the query and the logged in users permissions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

child

private final Item child
The item type of the child item.


parent

private final Item parent
The item type of the parent item.

Constructor Detail

QueryRuntimeFilterFactory.ChildFilter

QueryRuntimeFilterFactory.ChildFilter(Item child,
                                      Item parent)
Create a new ChildFilter object.

Parameters:
child - The item type of the child item
parent - The item type of the parent item
Method Detail

enableFilters

public void enableFilters(QueryRuntimeFilterManager manager,
                          EntityQuery query,
                          DbControl dc)
Description copied from interface: QueryRuntimeFilter
Enable the filters based on the options specified by the query and the logged in users permissions. Implementors should use the manager to enable the filters, not the HibernateUtil.enableFilter() method. The manager keeps track of already enabled filters and also takes care of disabling all filters after the query has been executed.

Specified by:
enableFilters in interface QueryRuntimeFilter
Parameters:
manager - A manager that is used to actually enabled the filter
query - The query that is going to be executed, it is not possible to modify the query, the actual HQL may already have been generated
dc - The DbControl used for database access and permission checking

2.17.2: 2011-06-17