1 | <?xml version="1.0"?> |
---|
2 | <!DOCTYPE hibernate-mapping PUBLIC |
---|
3 | "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
---|
4 | "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> |
---|
5 | <!-- |
---|
6 | $Id: filter-def.hbm.xml 6037 2012-03-29 09:50:36Z nicklas $ |
---|
7 | |
---|
8 | Copyright (C) 2005 Nicklas Nordborg |
---|
9 | Copyright (C) 2006 Jari Häkkinen |
---|
10 | |
---|
11 | This file is part of BASE - BioArray Software Environment. |
---|
12 | Available at http://base.thep.lu.se/ |
---|
13 | |
---|
14 | BASE is free software; you can redistribute it and/or |
---|
15 | modify it under the terms of the GNU General Public License |
---|
16 | as published by the Free Software Foundation; either version 3 |
---|
17 | of the License, or (at your option) any later version. |
---|
18 | |
---|
19 | BASE is distributed in the hope that it will be useful, |
---|
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
22 | GNU General Public License for more details. |
---|
23 | |
---|
24 | You should have received a copy of the GNU General Public License |
---|
25 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
26 | Foundation, Inc., 59 Temp le Place - Suite 330, |
---|
27 | --> |
---|
28 | <!-- |
---|
29 | This XML file contains predefined filters used |
---|
30 | by queries for filtering out items to which the logged |
---|
31 | in user doesn't have access. The actual filter expressions are |
---|
32 | added to the configuration by HibernateUtil.addFilterConditions(). |
---|
33 | The filter are applied at runtime by classes created by the |
---|
34 | QueryRuntimeFilterFactory. |
---|
35 | --> |
---|
36 | <hibernate-mapping> |
---|
37 | <!-- |
---|
38 | Do not return any items, since the user has been denied |
---|
39 | to all of them. |
---|
40 | --> |
---|
41 | <filter-def name="denyAll"> |
---|
42 | </filter-def> |
---|
43 | |
---|
44 | <!-- |
---|
45 | Filter Removable items on the isRemoved status |
---|
46 | Typical condition is ":removed = removed" |
---|
47 | --> |
---|
48 | <filter-def name="isRemoved"> |
---|
49 | <filter-param name="removed" type="boolean" /> |
---|
50 | </filter-def> |
---|
51 | |
---|
52 | <!-- |
---|
53 | Filter Annotatable items on the presense/absense of annotations |
---|
54 | Typical condition is ":annotated = (`annotationset_id` IS NULL)" |
---|
55 | --> |
---|
56 | <filter-def name="isAnnotated"> |
---|
57 | <filter-param name="annotated" type="boolean" /> |
---|
58 | </filter-def> |
---|
59 | |
---|
60 | <!-- |
---|
61 | Filter Ownable items on the owner to only return |
---|
62 | items owned by the logged in user. |
---|
63 | Typical condition is ":owner = owner" |
---|
64 | --> |
---|
65 | <filter-def name="ownedBy"> |
---|
66 | <filter-param name="owner" type="int" /> |
---|
67 | </filter-def> |
---|
68 | |
---|
69 | <!-- |
---|
70 | Filter Ownable items on the owner to only return |
---|
71 | items NOT owned by the logged in user. |
---|
72 | Typical condition is ":owner != owner" |
---|
73 | --> |
---|
74 | <filter-def name="notOwnedBy"> |
---|
75 | <filter-param name="owner" type="int" /> |
---|
76 | </filter-def> |
---|
77 | |
---|
78 | <!-- |
---|
79 | Filter items on the id to only return |
---|
80 | items that the logged in user is a member of. |
---|
81 | Typical condition is ":owner != owner AND id IN (:items)" |
---|
82 | --> |
---|
83 | <filter-def name="memberOf"> |
---|
84 | <filter-param name="owner" type="int" /> |
---|
85 | <filter-param name="items" type="int" /> |
---|
86 | </filter-def> |
---|
87 | |
---|
88 | <!-- |
---|
89 | Filter items on the owner and id |
---|
90 | to only return items where the logged in user is the owner or |
---|
91 | a member. |
---|
92 | Typical condition is ":owner = owner OR id IN (:items)" |
---|
93 | --> |
---|
94 | <filter-def name="ownedByOrMemberOf"> |
---|
95 | <filter-param name="owner" type="int" /> |
---|
96 | <filter-param name="items" type="int" /> |
---|
97 | </filter-def> |
---|
98 | |
---|
99 | <!-- |
---|
100 | Filter Shareable items on the item key to only return |
---|
101 | items that are shared to the logged in user. |
---|
102 | Typical condition is ":owner != owner AND itemkey_id IN (:itemKeys)" |
---|
103 | --> |
---|
104 | <filter-def name="sharedTo"> |
---|
105 | <filter-param name="owner" type="int" /> |
---|
106 | <filter-param name="itemKeys" type="int" /> |
---|
107 | </filter-def> |
---|
108 | |
---|
109 | <!-- |
---|
110 | Filter Shareable items on the owner and item key |
---|
111 | to only return items owned by or shared to |
---|
112 | the logged in user |
---|
113 | Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys)" |
---|
114 | --> |
---|
115 | <filter-def name="ownedByOrSharedTo"> |
---|
116 | <filter-param name="owner" type="int" /> |
---|
117 | <filter-param name="itemKeys" type="int" /> |
---|
118 | </filter-def> |
---|
119 | |
---|
120 | <!-- |
---|
121 | Filter Shareable items on the active project |
---|
122 | to only return items shared to the active project. |
---|
123 | Typical condition is "projectkey_id IN (:projectKeys)" |
---|
124 | --> |
---|
125 | <filter-def name="inProject"> |
---|
126 | <filter-param name="owner" type="int" /> |
---|
127 | <filter-param name="projectKeys" type="int" /> |
---|
128 | </filter-def> |
---|
129 | |
---|
130 | <!-- |
---|
131 | Filter Shareable items on the owner and the active project |
---|
132 | to only return items owned by logged in user or shared to |
---|
133 | the active project. |
---|
134 | Typical condition is ":owner = owner OR projectkey_id IN (:projectKeys)" |
---|
135 | --> |
---|
136 | <filter-def name="ownedByOrInProject"> |
---|
137 | <filter-param name="owner" type="int" /> |
---|
138 | <filter-param name="projectKeys" type="int" /> |
---|
139 | </filter-def> |
---|
140 | |
---|
141 | <!-- |
---|
142 | Filter Shareable items on the item key and the active project |
---|
143 | to only return items shared to the logged in user or to |
---|
144 | the active project. |
---|
145 | Typical condition is "(:owner != owner AND itemkey_id IN (:itemKeys)) OR projectkey_id IN (:projectKeys)" |
---|
146 | --> |
---|
147 | <filter-def name="sharedToOrInProject"> |
---|
148 | <filter-param name="owner" type="int" /> |
---|
149 | <filter-param name="itemKeys" type="int" /> |
---|
150 | <filter-param name="projectKeys" type="int" /> |
---|
151 | </filter-def> |
---|
152 | |
---|
153 | <!-- |
---|
154 | Filter Shareable items on the owner, item key and the active project |
---|
155 | to only return items owned by or shared to the logged in user, or shared to |
---|
156 | the active project. |
---|
157 | Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys) OR projectkey_id IN (:projectKeys)" |
---|
158 | --> |
---|
159 | <filter-def name="ownedByOrSharedToOrInProject"> |
---|
160 | <filter-param name="owner" type="int" /> |
---|
161 | <filter-param name="itemKeys" type="int" /> |
---|
162 | <filter-param name="projectKeys" type="int" /> |
---|
163 | </filter-def> |
---|
164 | |
---|
165 | <!-- |
---|
166 | Filter News on todays date. |
---|
167 | Typical condition is ":today >= start_date AND (:today <= end_date OR end_date IS NULL)" |
---|
168 | --> |
---|
169 | <filter-def name="todaysNews"> |
---|
170 | <filter-param name="today" type="date" /> |
---|
171 | </filter-def> |
---|
172 | |
---|
173 | <!-- |
---|
174 | Filter annotations on annotation types. This is needed so that |
---|
175 | only annotations that a user has access to can be loaded. |
---|
176 | Typical condition is: "`annotationtype_id` IN (:annotationTypes)" |
---|
177 | --> |
---|
178 | <filter-def name="annotationTypes"> |
---|
179 | <filter-param name="annotationTypes" type="int" /> |
---|
180 | </filter-def> |
---|
181 | </hibernate-mapping> |
---|