121 """ |
121 """ |
122 |
122 |
123 return super(View, self).list(request, access_type, page_name=page_name, |
123 return super(View, self).list(request, access_type, page_name=page_name, |
124 params=params, filter=kwargs) |
124 params=params, filter=kwargs) |
125 |
125 |
|
126 def _public(self, request, entity, context): |
|
127 """Performs any processing needed for the Document's public page. |
|
128 |
|
129 For args see base.View._public(). |
|
130 """ |
|
131 |
|
132 # check if the current user is allowed to visit the edit page |
|
133 rights = self._params['rights'] |
|
134 |
|
135 allowed_to_edit = False |
|
136 try: |
|
137 # use the IsDocumentWritable check because we have no django args |
|
138 rights.checkIsDocumentWritable({'key_name': entity.key().name()}, |
|
139 'key_name') |
|
140 allowed_to_edit = True |
|
141 except: |
|
142 pass |
|
143 |
|
144 if allowed_to_edit: |
|
145 context['edit_redirect'] = redirects.getEditRedirect( |
|
146 entity, {'url_name': 'document'}) |
|
147 |
|
148 return super(View, self)._public(request, entity, context) |
|
149 |
126 def _editPost(self, request, entity, fields): |
150 def _editPost(self, request, entity, fields): |
127 """See base.View._editPost(). |
151 """See base.View._editPost(). |
128 """ |
152 """ |
129 |
153 |
130 user = user_logic.getForCurrentAccount() |
154 user = user_logic.getForCurrentAccount() |