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 4429 2013-03-06 08:57:34Z olle $ |
---|
7 | |
---|
8 | Copyright (C) 2006 Gregory Vincic, Olle Mansson |
---|
9 | Copyright (C) 2007 Gregory Vincic |
---|
10 | |
---|
11 | This file is part of Proteios. |
---|
12 | Available at http://www.proteios.org/ |
---|
13 | |
---|
14 | Proteios is free software; you can redistribute it and/or modify it |
---|
15 | under the terms of the GNU General Public License as published by |
---|
16 | the Free Software Foundation; either version 2 of the License, or |
---|
17 | (at your option) any later version. |
---|
18 | |
---|
19 | Proteios is distributed in the hope that it will be useful, but |
---|
20 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
22 | General Public License for more details. |
---|
23 | |
---|
24 | You should have received a copy of the GNU General Public License |
---|
25 | along with this program; if not, write to the Free Software |
---|
26 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
27 | 02111-1307, USA. |
---|
28 | --> |
---|
29 | <!-- |
---|
30 | This XML file contains predefined filters used |
---|
31 | by queries for filtering out items to which the logged |
---|
32 | in user doesn't have access. The actual filter expressions are |
---|
33 | added to the configuration by HibernateUtil.addFilterConditions(). |
---|
34 | The filter are applied at runtime by classes created by the |
---|
35 | QueryRuntimeFilterFactory. |
---|
36 | --> |
---|
37 | <hibernate-mapping> |
---|
38 | <!-- |
---|
39 | Do not return any items, since the user has been denied |
---|
40 | to all of them. |
---|
41 | --> |
---|
42 | <filter-def name="denyAll"> |
---|
43 | </filter-def> |
---|
44 | |
---|
45 | <!-- |
---|
46 | Filter Removable items on the isRemoved status |
---|
47 | Typical condition is ":removed = removed" |
---|
48 | --> |
---|
49 | <filter-def name="isRemoved"> |
---|
50 | <filter-param name="removed" type="boolean" /> |
---|
51 | </filter-def> |
---|
52 | |
---|
53 | <!-- |
---|
54 | Filter Ownable items on the owner to only return |
---|
55 | items owned by the logged in user. |
---|
56 | Typical condition is ":owner = owner" |
---|
57 | --> |
---|
58 | <filter-def name="ownedBy"> |
---|
59 | <filter-param name="owner" type="int" /> |
---|
60 | </filter-def> |
---|
61 | |
---|
62 | <!-- |
---|
63 | Filter Ownable items on the owner to only return |
---|
64 | items NOT owned by the logged in user. |
---|
65 | Typical condition is ":owner != owner" |
---|
66 | --> |
---|
67 | <filter-def name="notOwnedBy"> |
---|
68 | <filter-param name="owner" type="int" /> |
---|
69 | </filter-def> |
---|
70 | |
---|
71 | <!-- |
---|
72 | Filter items on the id to only return |
---|
73 | items that the logged in user is a member of. |
---|
74 | Typical condition is ":owner != owner AND id IN (:items)" |
---|
75 | --> |
---|
76 | <filter-def name="memberOf"> |
---|
77 | <filter-param name="owner" type="int" /> |
---|
78 | <filter-param name="items" type="int" /> |
---|
79 | </filter-def> |
---|
80 | |
---|
81 | <!-- |
---|
82 | Filter items on the owner and id |
---|
83 | to only return items where the logged in user is the owner or |
---|
84 | a member. |
---|
85 | Typical condition is ":owner = owner OR id IN (:items)" |
---|
86 | --> |
---|
87 | <filter-def name="ownedByOrMemberOf"> |
---|
88 | <filter-param name="owner" type="int" /> |
---|
89 | <filter-param name="items" type="int" /> |
---|
90 | </filter-def> |
---|
91 | |
---|
92 | <!-- |
---|
93 | Filter Shareable items on the item key to only return |
---|
94 | items that are shared to the logged in user. |
---|
95 | Typical condition is ":owner != owner AND itemkey_id IN (:itemKeys)" |
---|
96 | --> |
---|
97 | <filter-def name="sharedTo"> |
---|
98 | <filter-param name="owner" type="int" /> |
---|
99 | <filter-param name="itemKeys" type="int" /> |
---|
100 | </filter-def> |
---|
101 | |
---|
102 | <!-- |
---|
103 | Filter Shareable items on the owner and item key |
---|
104 | to only return items owned by or shared to |
---|
105 | the logged in user |
---|
106 | Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys)" |
---|
107 | --> |
---|
108 | <filter-def name="ownedByOrSharedTo"> |
---|
109 | <filter-param name="owner" type="int" /> |
---|
110 | <filter-param name="itemKeys" type="int" /> |
---|
111 | </filter-def> |
---|
112 | |
---|
113 | <!-- |
---|
114 | Filter Shareable items on the active project |
---|
115 | to only return items shared to the active project. |
---|
116 | Typical condition is "projectkey_id IN (:projectKeys)" |
---|
117 | --> |
---|
118 | <filter-def name="inProject"> |
---|
119 | <filter-param name="owner" type="int" /> |
---|
120 | <filter-param name="projectKeys" type="int" /> |
---|
121 | </filter-def> |
---|
122 | |
---|
123 | <!-- |
---|
124 | Filter Shareable items on the owner and the active project |
---|
125 | to only return items owned by logged in user or shared to |
---|
126 | the active project. |
---|
127 | Typical condition is ":owner = owner OR projectkey_id IN (:projectKeys)" |
---|
128 | --> |
---|
129 | <filter-def name="ownedByOrInProject"> |
---|
130 | <filter-param name="owner" type="int" /> |
---|
131 | <filter-param name="projectKeys" type="int" /> |
---|
132 | </filter-def> |
---|
133 | |
---|
134 | <!-- |
---|
135 | Filter Shareable items on the item key and the active project |
---|
136 | to only return items shared to the logged in user or to |
---|
137 | the active project. |
---|
138 | Typical condition is "(:owner != owner AND itemkey_id IN (:itemKeys)) OR projectkey_id IN (:projectKeys)" |
---|
139 | --> |
---|
140 | <filter-def name="sharedToOrInProject"> |
---|
141 | <filter-param name="owner" type="int" /> |
---|
142 | <filter-param name="itemKeys" type="int" /> |
---|
143 | <filter-param name="projectKeys" type="int" /> |
---|
144 | </filter-def> |
---|
145 | |
---|
146 | <!-- |
---|
147 | Filter Shareable items on the owner, item key and the active project |
---|
148 | to only return items owned by or shared to the logged in user, or shared to |
---|
149 | the active project. |
---|
150 | Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys) OR projectkey_id IN (:projectKeys)" |
---|
151 | --> |
---|
152 | <filter-def name="ownedByOrSharedToOrInProject"> |
---|
153 | <filter-param name="owner" type="int" /> |
---|
154 | <filter-param name="itemKeys" type="int" /> |
---|
155 | <filter-param name="projectKeys" type="int" /> |
---|
156 | </filter-def> |
---|
157 | |
---|
158 | <!-- |
---|
159 | Filter News on todays date. |
---|
160 | Typical condition is ":today >= start_date AND (:today <= end_date OR end_date IS NULL)" |
---|
161 | --> |
---|
162 | <filter-def name="todaysNews"> |
---|
163 | <filter-param name="today" type="timestamp" /> |
---|
164 | </filter-def> |
---|
165 | </hibernate-mapping> |
---|