Revision 1304
Added by Jing Tao about 22 years ago
src/edu/ucsb/nceas/metacat/QuerySpecification.java | ||
---|---|---|
195 | 195 |
if (userName != null && !userName.equals("")) |
196 | 196 |
{ |
197 | 197 |
allowQuery = allowQuery +"(principal_name = '" + userName |
198 |
+"' AND perm_type = 'allow')"; |
|
198 |
+"' AND perm_type = 'allow'" |
|
199 |
+" AND (permission='4' OR permission='7'))"; |
|
199 | 200 |
} |
200 | 201 |
// add allow rule for public |
201 | 202 |
allowQuery = allowQuery +"OR (principal_name = '" + PUBLIC |
202 |
+"' AND perm_type = 'allow')"; |
|
203 |
+"' AND perm_type = 'allow'" |
|
204 |
+" AND (permission='4' OR permission='7'))"; |
|
203 | 205 |
|
204 | 206 |
// add allow rule for group |
205 | 207 |
if (group != null) |
... | ... | |
210 | 212 |
if (groupUint != null && !groupUint.equals("")) |
211 | 213 |
{ |
212 | 214 |
allowQuery = allowQuery +" OR (principal_name = '" + groupUint |
213 |
+"' AND perm_type = 'allow')"; |
|
215 |
+"' AND perm_type = 'allow'" |
|
216 |
+" AND (permission='4' OR permission='7'))"; |
|
214 | 217 |
}//if |
215 | 218 |
}//for |
216 | 219 |
}//if |
... | ... | |
233 | 236 |
{ |
234 | 237 |
denyQuery = denyQuery +"(principal_name = '" + userName |
235 | 238 |
+"' AND perm_type = 'deny' " |
236 |
+"AND perm_order ='allowFirst')"; |
|
239 |
+"AND perm_order ='allowFirst'" |
|
240 |
+" AND (permission='4' OR permission='7'))"; |
|
237 | 241 |
} |
238 | 242 |
// add deny rule for public |
239 | 243 |
denyQuery = denyQuery +"OR (principal_name = '" + PUBLIC |
240 | 244 |
+"' AND perm_type = 'deny' " |
241 |
+"AND perm_order ='allowFirst')"; |
|
245 |
+"AND perm_order ='allowFirst'" |
|
246 |
+" AND (permission='4' OR permission='7'))"; |
|
242 | 247 |
|
243 | 248 |
// add allow rule for group |
244 | 249 |
if (group != null) |
... | ... | |
250 | 255 |
{ |
251 | 256 |
denyQuery = denyQuery +" OR (principal_name = '" + groupUint |
252 | 257 |
+"' AND perm_type = 'deny' " |
253 |
+"AND perm_order ='allowFirst')"; |
|
258 |
+"AND perm_order ='allowFirst'" |
|
259 |
+" AND (permission='4' OR permission='7'))"; |
|
254 | 260 |
}//if |
255 | 261 |
}//for |
256 | 262 |
}//if |
Also available in: Unified diff
In accessQuery, permission=READ or permission=ALL was added for both allow rule and deny rule.