132 Returns a custom sidebar entry for the 'site' singleton. |
132 Returns a custom sidebar entry for the 'site' singleton. |
133 """ |
133 """ |
134 |
134 |
135 entity = self._logic.getSingleton() |
135 entity = self._logic.getSingleton() |
136 |
136 |
137 submenus = [] |
137 submenus = document_view.view.getMenusForScope(entity, self._params) |
138 |
138 |
139 if entity: |
139 try: |
140 submenus += document_view.view.getMenusForScope(entity, self._params) |
140 rights = self._params['rights'] |
141 |
141 rights.setCurrentUser(id, user) |
142 try: |
142 rights.checkIsHost() |
143 rights = self._params['rights'] |
143 is_host = True |
144 rights.setCurrentUser(id, user) |
144 except out_of_band.Error: |
145 rights.checkIsHost() |
145 is_host = False |
146 is_host = True |
146 |
147 except out_of_band.Error: |
147 if is_host: |
148 is_host = False |
148 submenus += [(redirects.getCreateDocumentRedirect(entity, 'site'), |
149 |
149 "Create a New Document", 'any_access')] |
150 if is_host: |
150 |
151 submenus += [(redirects.getCreateDocumentRedirect(entity, 'site'), |
151 submenus += [(redirects.getListDocumentsRedirect(entity, 'site'), |
152 "Create a New Document", 'any_access')] |
152 "List Documents", 'any_access')] |
153 |
|
154 submenus += [(redirects.getListDocumentsRedirect(entity, 'site'), |
|
155 "List Documents", 'any_access')] |
|
156 |
153 |
157 new_params = {} |
154 new_params = {} |
158 new_params['sidebar_additional'] = submenus |
155 new_params['sidebar_additional'] = submenus |
159 |
156 |
160 params = dicts.merge(params, new_params) |
157 params = dicts.merge(params, new_params) |