Project

General

Profile

Bug #2557 » soil-query5.sql

Matt Jones, 09/28/2006 09:12 AM

 
1
SELECT docid,docname,doctype,date_created, date_updated, rev 
2
  FROM xml_documents 
3
 WHERE 
4
        docid IN (SELECT docid FROM xml_documents WHERE lower(user_owner) ='public') 
5
              OR (docid IN 
6
                           (
7
                                      SELECT docid from xml_access 
8
                                       WHERE (
9
                                                (
10
                                                 lower(principal_name) = 'public' 
11
                                                 AND perm_type = 'allow' 
12
                                                 AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
13
                                                )
14
                                                OR 
15
                                                (
16
                                                     lower(principal_name) = 'public' 
17
                                                     AND perm_type = 'allow' 
18
                                                     AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
19
                                                )
20
                                             ) 
21
                                         AND subtreeid IS NULL
22
                           ) 
23
                  AND docid NOT IN (
24
                                      SELECT docid from xml_access 
25
                                       WHERE (
26
                                                (
27
                                                   lower(principal_name) = 'public' 
28
                                                   AND perm_type = 'deny' 
29
                                                   AND perm_order ='allowFirst' 
30
                                                   AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
31
                                                )
32
                                                OR 
33
                                                (
34
                                                   lower(principal_name) = 'public' 
35
                                                   AND perm_type = 'deny' 
36
                                                   AND perm_order ='allowFirst' 
37
                                                   AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
38
                                                )
39
                                             ) 
40
                                         AND subtreeid IS NULL 
41
                                   )
42
                 )
(1-1/2)