|
@@ -24,6 +24,7 @@ from pboard.lib.base import BaseController
|
24
|
24
|
from pboard.lib import dbapi as pld
|
25
|
25
|
from pboard.model import data as pmd
|
26
|
26
|
from pboard import model as pm
|
|
27
|
+from pboard.lib.auth import can_read, can_write
|
27
|
28
|
|
28
|
29
|
__all__ = ['PODPublicApiController', 'PODApiController']
|
29
|
30
|
|
|
@@ -141,6 +142,7 @@ class PODApiController(BaseController):
|
141
|
142
|
redirect(lurl('/document/%i'%(loNewNode.parent_id)))
|
142
|
143
|
|
143
|
144
|
@expose()
|
|
145
|
+ @require(can_read())
|
144
|
146
|
def get_file_content(self, node_id=None, **kw):
|
145
|
147
|
if node_id==None:
|
146
|
148
|
return
|
|
@@ -177,6 +179,7 @@ class PODApiController(BaseController):
|
177
|
179
|
return loResultBuffer.getvalue()
|
178
|
180
|
|
179
|
181
|
@expose()
|
|
182
|
+ @require(can_write())
|
180
|
183
|
def set_parent_node(self, node_id, new_parent_id, **kw):
|
181
|
184
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
182
|
185
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -189,6 +192,7 @@ class PODApiController(BaseController):
|
189
|
192
|
redirect(lurl('/document/%s'%(node_id)))
|
190
|
193
|
|
191
|
194
|
@expose()
|
|
195
|
+ @require(can_write())
|
192
|
196
|
def move_node_upper(self, node_id=0):
|
193
|
197
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
194
|
198
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -199,6 +203,7 @@ class PODApiController(BaseController):
|
199
|
203
|
redirect(lurl('/document/%s'%(node_id)))
|
200
|
204
|
|
201
|
205
|
@expose()
|
|
206
|
+ @require(can_write())
|
202
|
207
|
def move_node_lower(self, node_id=0):
|
203
|
208
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
204
|
209
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -234,6 +239,7 @@ class PODApiController(BaseController):
|
234
|
239
|
redirect(lurl('/document/%i'%(loNewNode.node_id)))
|
235
|
240
|
|
236
|
241
|
@expose()
|
|
242
|
+ @require(can_write())
|
237
|
243
|
def edit_status(self, node_id, node_status):
|
238
|
244
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
239
|
245
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -243,6 +249,7 @@ class PODApiController(BaseController):
|
243
|
249
|
redirect(lurl('/document/%s'%(node_id)))
|
244
|
250
|
|
245
|
251
|
@expose()
|
|
252
|
+ @require(can_write())
|
246
|
253
|
def edit_label_and_content(self, node_id, data_label, data_content):
|
247
|
254
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
248
|
255
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -253,6 +260,7 @@ class PODApiController(BaseController):
|
253
|
260
|
redirect(lurl('/document/%s'%(node_id)))
|
254
|
261
|
|
255
|
262
|
@expose()
|
|
263
|
+ @require(can_write())
|
256
|
264
|
def force_delete_node(self, node_id=None):
|
257
|
265
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
258
|
266
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -284,6 +292,7 @@ class PODApiController(BaseController):
|
284
|
292
|
redirect(lurl('/document/%s'%(back_to_node_id)))
|
285
|
293
|
|
286
|
294
|
@expose()
|
|
295
|
+ @require(can_write())
|
287
|
296
|
def toggle_share_status(self, node_id):
|
288
|
297
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
289
|
298
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|