Browse Source

Merge branch 'master' of bitbucket.org:lebouquetin/protov1

sferot 10 years ago
parent
commit
42bde56aa4

+ 1 - 1
pboard/pboard/controllers/api.py View File

@@ -62,7 +62,7 @@ class PODPublicApiController(BaseController):
62 62
         loUserSpecificGroup = pld.PODStaticController.createGroup()
63 63
 
64 64
         loUserSpecificGroup.group_id = 0-loNewAccount.user_id # group id of a given user is the opposite of the user id
65
-        loUserSpecificGroup.group_name = ''
65
+        loUserSpecificGroup.group_name = 'user_%d' % loNewAccount.user_id
66 66
         loUserSpecificGroup.personnal_group = True
67 67
         loUserSpecificGroup.users.append(loNewAccount)
68 68
 

+ 2 - 2
pboard/pboard/controllers/root.py View File

@@ -147,8 +147,8 @@ class RootController(BaseController):
147 147
             current_node=loCurrentNode,
148 148
             node_status_list = loNodeStatusList,
149 149
             keywords = highlight,
150
-            user_specific_groups = pld.PODStaticController.getUserSpecificGroups(),
151
-            real_groups = pld.PODStaticController.getRealGroups()
150
+            user_specific_group_rights = pld.PODStaticController.getUserDedicatedGroupRightsOnNode(node_id),
151
+            real_group_rights = pld.PODStaticController.getRealGroupRightsOnNode(node_id)
152 152
         )
153 153
 
154 154
     @expose('pboard.templates.search')

+ 33 - 38
pboard/pboard/lib/auth.py View File

@@ -3,6 +3,30 @@
3 3
 from tg.predicates import Predicate
4 4
 from pboard.model import DBSession as session
5 5
 from pboard.model.auth import Permission, User
6
+import logging as l
7
+
8
+DIRTY_canReadOrCanWriteSqlQuery = """
9
+SELECT
10
+    node_id
11
+FROM
12
+    pod_group_node AS pgn
13
+    join pod_user_group AS pug on pug.group_id = pgn.group_id
14
+    join pod_user AS pu ON pug.user_id = pu.user_id
15
+WHERE
16
+    rights > :excluded_right_low_level
17
+    AND email_address = :email
18
+    AND node_id = :node_id
19
+UNION
20
+    SELECT
21
+        node_id
22
+    FROM
23
+        pod_nodes AS pnn,
24
+        pod_user AS puu
25
+    WHERE
26
+        pnn.node_id = :node_id
27
+        AND pnn.owner_id = puu.user_id
28
+        AND puu.email_address = :email
29
+"""
6 30
 
7 31
 class can_read(Predicate):
8 32
     message = ""
@@ -14,26 +38,12 @@ class can_read(Predicate):
14 38
         if 'node_id' in environ['webob.adhoc_attrs']['validation']['values']:
15 39
             node_id = environ['webob.adhoc_attrs']['validation']['values']['node_id']
16 40
             if node_id!=0:
17
-                has_right = session.execute("""
18
-                    select
19
-                        node_id
20
-                    from
21
-                        pod_group_node pgn
22
-                        join pod_user_group pug on pug.group_id = pgn.group_id
23
-                        join pod_user pu on pug.user_id = pu.user_id
24
-                    where
25
-                        rights > 0
26
-                        and email_address = :mail
27
-                        and node_id = :node
28
-                    union
29
-                        select
30
-                            node_id
31
-                        from
32
-                            pod_nodes
33
-                        where
34
-                            node_id = :node
35
-                        """, {"mail":credentials["repoze.who.userid"], "node":node_id})
41
+                has_right = session.execute(
42
+                    DIRTY_canReadOrCanWriteSqlQuery,
43
+                    {"email":credentials["repoze.who.userid"], "node_id":node_id, "excluded_right_low_level": 0}
44
+                )
36 45
                 if has_right.rowcount == 0 :
46
+                    l.info("User {} don't have read right on node {}".format(credentials["repoze.who.userid"], node_id))
37 47
                     self.unmet()
38 48
 
39 49
 class can_write(Predicate):
@@ -46,25 +56,10 @@ class can_write(Predicate):
46 56
         if 'node_id' in environ['webob.adhoc_attrs']['validation']['values']:
47 57
             node_id = environ['webob.adhoc_attrs']['validation']['values']['node_id']
48 58
             if node_id!=0:
49
-                has_right = session.execute("""
50
-                        select
51
-                            node_id
52
-                        from
53
-                            pod_group_node pgn
54
-                            join pod_user_group pug on pug.group_id = pgn.group_id
55
-                            join pod_user pu on pug.user_id = pu.user_id
56
-                        where
57
-                            rights > 1
58
-                            and email_address = :mail
59
-                            and node_id = :node
60
-                        union
61
-                            select
62
-                                node_id
63
-                            from
64
-                                pod_nodes
65
-                            where
66
-                                node_id = :node
67
-                        """, {"mail":credentials["repoze.who.userid"], "node":node_id})
59
+                has_right = session.execute(
60
+                    DIRTY_canReadOrCanWriteSqlQuery,
61
+                    {"email":credentials["repoze.who.userid"], "node_id":node_id, "excluded_right_low_level": 1}
62
+                )
68 63
                 if has_right.rowcount == 0 :
69 64
                     self.unmet()
70 65
 

+ 74 - 19
pboard/pboard/lib/dbapi.py View File

@@ -52,12 +52,28 @@ class PODStaticController(object):
52 52
     return loGroups
53 53
 
54 54
   @classmethod
55
-  def getUserSpecificGroups(cls):
56
-    return DBSession.query(pbma.Group).filter(pbma.Group.personnal_group==True).all()
55
+  def getRealGroupRightsOnNode(cls, piNodeId: int) -> pbmd.DIRTY_GroupRightsOnNode:
56
+
57
+    groupRightsOnNodeCustomSelect = DBSession\
58
+        .query(pbmd.DIRTY_GroupRightsOnNode)\
59
+        .from_statement(pbmd.DIRTY_RealGroupRightOnNodeSqlQuery)\
60
+        .params(node_id=piNodeId)\
61
+        .all()
62
+
63
+    return groupRightsOnNodeCustomSelect
57 64
 
58 65
   @classmethod
59
-  def getRealGroups(cls):
60
-    return DBSession.query(pbma.Group).filter(pbma.Group.personnal_group==False).all()
66
+  def getUserDedicatedGroupRightsOnNode(cls, piNodeId: int) -> pbmd.DIRTY_GroupRightsOnNode:
67
+
68
+    groupRightsOnNodeCustomSelect = DBSession\
69
+        .query(pbmd.DIRTY_GroupRightsOnNode)\
70
+        .from_statement(pbmd.DIRTY_UserDedicatedGroupRightOnNodeSqlQuery)\
71
+        .params(node_id=piNodeId)\
72
+        .all()
73
+
74
+    return groupRightsOnNodeCustomSelect
75
+
76
+
61 77
 
62 78
 class PODUserFilteredApiController(object):
63 79
   
@@ -79,7 +95,8 @@ class PODUserFilteredApiController(object):
79 95
   def createNode(self, parent_id=0):
80 96
     loNode          = pbmd.PBNode()
81 97
     loNode.owner_id = self._iCurrentUserId
82
-    loNode.parent_id = parent_id
98
+    if int(parent_id)!=0:
99
+      loNode.parent_id = parent_id
83 100
     parent_rights = DBSession.query(pbma.Rights).filter(pbma.Rights.node_id==parent_id).all()
84 101
     loNode.rights = parent_rights
85 102
     loNode.rights = [pbma.Rights(group_id=r.group_id, rights=r.rights) for r in parent_rights]
@@ -93,18 +110,34 @@ class PODUserFilteredApiController(object):
93 110
     return loNewNode
94 111
 
95 112
 
96
-  def getNode(self, liNodeId):
97
-    liOwnerIdList = self._getUserIdListForFiltering()
98
-    if liNodeId!=0:
99
-      return DBSession.query(pbmd.PBNode).options(joinedload_all("_lAllChildren")).\
100
-              join(pbma.Group.users).\
101
-              filter(pbmd.PBNode.node_id==liNodeId).\
102
-              filter((pbmd.PBNode.owner_id.in_(liOwnerIdList)) | (pbma.user_group_table.c.user_id.in_(liOwnerIdList))).\
103
-              first()
104
-    return None
113
+  def getNode(self, liNodeId: int) -> pbmd.PBNode:
105 114
 
115
+    lsSqlSelectQuery = """pod_nodes.node_id IN
116
+        (SELECT
117
+            pgn.node_id
118
+        FROM
119
+            pod_group_node AS pgn
120
+            join pod_user_group AS pug ON pug.group_id = pgn.group_id
121
+            join pod_user AS pu ON pug.user_id = pu.user_id
122
+        WHERE
123
+            rights > 0
124
+            AND pu.user_id = %s)
125
+    """
126
+    lsNodeIdFiltering = lsSqlSelectQuery % (str(self._iCurrentUserId))
127
+
128
+    if liNodeId!=None and liNodeId!=0:
129
+      return DBSession.query(pbmd.PBNode).options(joinedload_all("_lAllChildren"))\
130
+        .filter(pbmd.PBNode.node_id==liNodeId)\
131
+        .filter(
132
+          sqla.or_(
133
+            pbmd.PBNode.owner_id==self._iCurrentUserId,
134
+            lsNodeIdFiltering
135
+          )
136
+        )\
137
+        .one()
138
+    return None
106 139
 
107
-  def getLastModifiedNodes(self, piMaxNodeNb):
140
+  def getLastModifiedNodes(self, piMaxNodeNb: int):
108 141
     """
109 142
     Returns a list of nodes order by modification time and limited to piMaxNodeNb nodes
110 143
     """
@@ -112,7 +145,7 @@ class PODUserFilteredApiController(object):
112 145
     return DBSession.query(pbmd.PBNode).options(joinedload_all("_lAllChildren")).filter(pbmd.PBNode.owner_id.in_(liOwnerIdList)).order_by(pbmd.PBNode.updated_at.desc()).limit(piMaxNodeNb).all()
113 146
 
114 147
 
115
-  def searchNodesByText(self, plKeywordList, piMaxNodeNb=100):
148
+  def searchNodesByText(self, plKeywordList: [str], piMaxNodeNb=100):
116 149
     """
117 150
     Returns a list of nodes order by type, nodes which contain at least one of the keywords
118 151
     """
@@ -142,7 +175,19 @@ class PODUserFilteredApiController(object):
142 175
   def buildTreeListForMenu(self, plViewableStatusId):
143 176
     liOwnerIdList = self._getUserIdListForFiltering()
144 177
     
145
-    loNodeList = pbm.DBSession.query(pbmd.PBNode).filter(pbmd.PBNode.owner_id.in_(liOwnerIdList)).filter(pbmd.PBNode.node_type==pbmd.PBNodeType.Data).filter(pbmd.PBNode.node_status.in_(plViewableStatusId)).order_by(pbmd.PBNode.parent_tree_path).order_by(pbmd.PBNode.node_order).order_by(pbmd.PBNode.node_id).all()
178
+    # loNodeList = pbm.DBSession.query(pbmd.PBNode).filter(pbmd.PBNode.owner_id.in_(liOwnerIdList)).filter(pbmd.PBNode.node_type==pbmd.PBNodeType.Data).filter(pbmd.PBNode.node_status.in_(plViewableStatusId)).order_by(pbmd.PBNode.parent_tree_path).order_by(pbmd.PBNode.node_order).order_by(pbmd.PBNode.node_id).all()
179
+    loNodeListNotFiltered = pbm.DBSession.query(pbmd.PBNode).filter(pbmd.PBNode.node_type==pbmd.PBNodeType.Data).filter(pbmd.PBNode.node_status.in_(plViewableStatusId)).order_by(pbmd.PBNode.parent_tree_path).order_by(pbmd.PBNode.node_order).order_by(pbmd.PBNode.node_id).all()
180
+
181
+    loNodeList = []
182
+    for loNode in loNodeListNotFiltered:
183
+      if loNode.owner_id in self._getUserIdListForFiltering():
184
+        loNodeList.append(loNode)
185
+      else:
186
+        for loRight in loNode._lRights:
187
+          for loUser in loRight._oGroup.users:
188
+            if loUser.user_id in self._getUserIdListForFiltering():
189
+              loNodeList.append(loNode)
190
+
146 191
     loTreeList = []
147 192
     loTmpDict = {}
148 193
     for loNode in loNodeList:
@@ -157,8 +202,18 @@ class PODUserFilteredApiController(object):
157 202
         # We suppose that the parent node has already been added
158 203
         # this *should* be the case, but the code does not check it
159 204
         if loNode.parent_id not in loTmpDict.keys():
160
-          loTmpDict[loNode.parent_id] = self.getNode(loNode.parent_id)
161
-        loTmpDict[loNode.parent_id].appendStaticChild(loNode)
205
+          print('THE NODE =========',loNode.parent_id)
206
+          try:
207
+            loTmpDict[loNode.parent_id] = self.getNode(loNode.parent_id)
208
+          except Exception as e:
209
+            # loTreeList.append(
210
+            # FIXME - D.A. - 2014-05-22 This may be wrong code:
211
+            # we are in the case when the node parent is not shared with the current user
212
+            # So the node should be added at the root
213
+            pass
214
+        if loNode.parent_id in loTmpDict.keys():
215
+          # HACK- D.A. - 2014-05-22 - See FIXME upper
216
+          loTmpDict[loNode.parent_id].appendStaticChild(loNode)
162 217
   
163 218
     return loTreeList
164 219
 

+ 2 - 1
pboard/pboard/model/auth.py View File

@@ -70,7 +70,8 @@ class Group(DeclarativeBase):
70 70
     display_name = Column(Unicode(255))
71 71
     created = Column(DateTime, default=datetime.now)
72 72
     personnal_group = Column(Boolean)
73
-    users = relation('User', secondary=user_group_table, backref='groups')
73
+
74
+    users = relationship('User', secondary=user_group_table, backref='groups')
74 75
 
75 76
     _lRights = relationship('Rights', backref='_oGroup', cascade = "all, delete-orphan")
76 77
 

+ 75 - 0
pboard/pboard/model/data.py View File

@@ -8,11 +8,14 @@ from hashlib import sha256
8 8
 
9 9
 import bs4
10 10
 from sqlalchemy import Table, ForeignKey, Column, Sequence
11
+import sqlalchemy as sqla
12
+from sqlalchemy.sql.sqltypes import Boolean
11 13
 from sqlalchemy.types import Unicode, Integer, DateTime, Text, LargeBinary
12 14
 import sqlalchemy.types as sqlat
13 15
 from sqlalchemy.orm import relation, synonym, relationship
14 16
 from sqlalchemy.orm import backref
15 17
 import sqlalchemy.orm as sqlao
18
+import sqlalchemy.orm.query as sqlaoq
16 19
 from sqlalchemy import orm as sqlao
17 20
 
18 21
 from tg.i18n import ugettext as _, lazy_ugettext as l_
@@ -399,3 +402,75 @@ class PBNode(DeclarativeBase):
399 402
   def getHistory(self):
400 403
       return DBSession.execute("select node_id, version_id, created_at from pod_nodes_history where node_id = :node_id order by created_at desc", {"node_id":self.node_id}).fetchall()
401 404
 
405
+
406
+#####
407
+#
408
+# HACK - 2014-05-21 - D.A
409
+#
410
+# The following hack is a horrible piece of code that allow to map a raw SQL select to a mapped class
411
+#
412
+class DIRTY_GroupRightsOnNode(object):
413
+    def hasSomeAccess(self):
414
+        return self.rights >= pma.Rights.READ_ACCESS
415
+
416
+    def hasReadAccess(self):
417
+        return self.rights & pma.Rights.READ_ACCESS
418
+
419
+    def hasWriteAccess(self):
420
+        return self.rights & pma.Rights.WRITE_ACCESS
421
+
422
+DIRTY_group_rights_on_node_query = Table('fake_table', metadata,
423
+    Column('group_id', Integer, primary_key=True),
424
+    Column('node_id', Integer, primary_key=True),
425
+
426
+    Column('display_name', Unicode(255)),
427
+    Column('personnal_group', Boolean),
428
+    Column('rights', Integer, primary_key=True)
429
+)
430
+
431
+DIRTY_UserDedicatedGroupRightOnNodeSqlQuery = """
432
+SELECT
433
+    COALESCE(NULLIF(pg.display_name, ''), pu.display_name) AS display_name,
434
+    pg.personnal_group,
435
+    pg.group_id,
436
+    :node_id AS node_id,
437
+    COALESCE(pgn.rights, 0) AS rights
438
+FROM
439
+    pod_group AS pg
440
+    LEFT JOIN
441
+        pod_group_node AS pgn
442
+    ON
443
+        pg.group_id=pgn.group_id
444
+        AND pgn.node_id=:node_id
445
+    LEFT JOIN
446
+        pod_user AS pu
447
+    ON
448
+        pu.user_id=-pg.group_id
449
+WHERE
450
+    pg.personnal_group='t'
451
+ORDER BY
452
+    display_name
453
+;"""
454
+
455
+DIRTY_RealGroupRightOnNodeSqlQuery = """
456
+SELECT
457
+    pg.display_name AS display_name,
458
+    pg.personnal_group,
459
+    pg.group_id,
460
+    :node_id AS node_id,
461
+    COALESCE(pgn.rights, 0) AS rights
462
+FROM
463
+    pod_group AS pg
464
+    LEFT JOIN
465
+        pod_group_node AS pgn
466
+    ON
467
+        pg.group_id=pgn.group_id
468
+        AND pgn.node_id=:node_id
469
+WHERE
470
+    pg.personnal_group!='t'
471
+ORDER BY
472
+    display_name
473
+;"""
474
+
475
+sqlao.mapper(DIRTY_GroupRightsOnNode, DIRTY_group_rights_on_node_query)
476
+

+ 39 - 48
pboard/pboard/templates/document-widgets-tabs.mak View File

@@ -33,21 +33,17 @@
33 33
           <th></th>
34 34
         </tr>
35 35
       </thead>
36
-      % for loCurrentGroup in real_groups:
37
-        % if loCurrentGroup.hasSomeAccess(poNode):
36
+      % for loGroupRightsOnNode in real_group_rights:
37
+        % if loGroupRightsOnNode.hasSomeAccess():
38 38
           <tr>
39
-            <td>${loCurrentGroup.getDisplayName()}</td>
39
+            <td>${loGroupRightsOnNode.display_name}</td>
40 40
             <td>
41
-              % for loRight in loCurrentGroup.rights:
42
-                % if loRight.node_id==poNode.node_id:
43
-                  % if loRight.hasReadAccess():
44
-                    <span class="label label-success">R</span>
45
-                  % endif
46
-                  % if loRight.hasWriteAccess():
47
-                    <span class="label label-warning">W</span>
48
-                  % endif
49
-                % endif
50
-              % endfor
41
+              % if loGroupRightsOnNode.hasReadAccess():
42
+                <span class="label label-success">R</span>
43
+              % endif
44
+              % if loGroupRightsOnNode.hasWriteAccess():
45
+                <span class="label label-warning">W</span>
46
+              % endif
51 47
             </td>
52 48
           </tr>
53 49
         % endif
@@ -58,21 +54,17 @@
58 54
           <th></th>
59 55
         </tr>
60 56
       </thead>
61
-      % for loCurrentGroup in user_specific_groups:
62
-        % if loCurrentGroup.hasSomeAccess(poNode):
57
+      % for loGroupRightsOnNode in user_specific_group_rights:
58
+        % if loGroupRightsOnNode.hasSomeAccess():
63 59
           <tr>
64
-            <td>${loCurrentGroup.getDisplayName()}</td>
60
+            <td>${loGroupRightsOnNode.display_name}</td>
65 61
             <td>
66
-              % for loRight in loCurrentGroup.rights:
67
-                % if loRight.node_id==poNode.node_id:
68
-                  % if loRight.hasReadAccess():
69
-                    <span class="label label-success">R</span>
70
-                  % endif
71
-                  % if loRight.hasWriteAccess():
72
-                    <span class="label label-warning">W</span>
73
-                  % endif
74
-                % endif
75
-              % endfor
62
+              % if loGroupRightsOnNode.hasReadAccess():
63
+                <span class="label label-success">R</span>
64
+              % endif
65
+              % if loGroupRightsOnNode.hasWriteAccess():
66
+                <span class="label label-warning">W</span>
67
+              % endif
76 68
             </td>
77 69
           </tr>
78 70
         % endif
@@ -178,22 +170,23 @@
178 170
                   <th>${_('Access')}</th>
179 171
                 </tr>
180 172
               </thead>
181
-              % for loCurrentGroup in real_groups:
182
-              <tr id='user-${loCurrentGroup.group_id}-rights-row'>
173
+              % for loGroupRightsOnNode in real_group_rights:
174
+
175
+              <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
183 176
                 <td>
184 177
                   <a
185 178
                     class="btn btn-mini"
186
-                    onclick="updateRights(${loCurrentGroup.group_id})"
179
+                    onclick="updateRights(${loGroupRightsOnNode.group_id})"
187 180
                   >
188 181
                     <i class="fa fa-key"></i>
189 182
                   </a>
190 183
                 </td>
191 184
                 <td class='pod-highlightable-access-management-cell'>
192
-                  ${loCurrentGroup.getDisplayName()}
193
-                  <input type="hidden" id="user-${loCurrentGroup.group_id}-value-read" name="read" value="" />
194
-                  <input type="hidden" id="user-${loCurrentGroup.group_id}-value-write" name="write" value="" />
185
+                  ${loGroupRightsOnNode.display_name}
186
+                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
187
+                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
195 188
                 </td>
196
-                <td id="user-${loCurrentGroup.group_id}-rights" class="pod-right-cell"></td>
189
+                <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
197 190
               </tr>
198 191
               % endfor
199 192
               
@@ -208,23 +201,23 @@
208 201
                   <th>${_('Access')}</th>
209 202
                 </tr>
210 203
               </thead>
211
-              % for loCurrentGroup in user_specific_groups:
204
+              % for loGroupRightsOnNode in user_specific_group_rights:
212 205
               
213
-              <tr id='user-${loCurrentGroup.group_id}-rights-row'>
206
+              <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
214 207
                 <td>
215 208
                   <a
216 209
                     class="btn btn-mini"
217
-                    onclick="updateRights(${loCurrentGroup.group_id})"
210
+                    onclick="updateRights(${loGroupRightsOnNode.group_id})"
218 211
                   >
219 212
                     <i class="fa fa-key"></i>
220 213
                   </a>
221 214
                 </td>
222 215
                 <td class='pod-highlightable-access-management-cell'>
223
-                  ${loCurrentGroup.getDisplayName()}
224
-                  <input type="hidden" id="user-${loCurrentGroup.group_id}-value-read" name="read" value="" />
225
-                  <input type="hidden" id="user-${loCurrentGroup.group_id}-value-write" name="write" value="" />
216
+                  ${loGroupRightsOnNode.display_name}
217
+                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
218
+                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
226 219
                 </td>
227
-                <td id="user-${loCurrentGroup.group_id}-rights" class="pod-right-cell"></td>
220
+                <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
228 221
               </tr>
229 222
               % endfor
230 223
             </table>
@@ -348,18 +341,16 @@
348 341
 ## for read/write access management
349 342
 ##
350 343
 
351
-      % for loCurrentGroup in real_groups + user_specific_groups:
352
-        % if loCurrentGroup.hasSomeAccess(poNode)==False:
353
-              updateRights(${loCurrentGroup.group_id}, 0);
344
+## FIXME      % for loGroupRightsOnNode in real_group_rights:
345
+##      % for loCurrentGroup in real_group_rights + user_specific_group_rights:
346
+      % for loGroupRightsOnNode in real_group_rights + user_specific_group_rights:
347
+        % if loGroupRightsOnNode.hasSomeAccess()==False:
348
+          updateRights(${loGroupRightsOnNode.group_id}, 0);
354 349
         % else:
355
-          % for loRight in loCurrentGroup.rights:
356
-            % if loRight.node_id==poNode.node_id:
357 350
 ##
358 351
 ## The following line should build some javascript code similar to this:
359 352
 ## updateRights(-5, 3);
360
-              updateRights(${loCurrentGroup.group_id}, ${loRight.rights});
361
-            % endif
362
-          % endfor
353
+          updateRights(${loGroupRightsOnNode.group_id}, ${loGroupRightsOnNode.rights});
363 354
         % endif
364 355
       % endfor
365 356
 

+ 3 - 0
pboard/pboard/templates/master.mak View File

@@ -172,6 +172,9 @@
172 172
                 <li><a href="${tg.url('/debug/identity')}"><i class="fa fa-user-md"></i>  request.identity</a></li>
173 173
               </ul>
174 174
             </li>
175
+          % endif
176
+
177
+          % if request.identity:
175 178
             <li>
176 179
               <form class="navbar-search  form-search" action="${tg.url('/search')}">
177 180
                 <div class="input-append">