|
@@ -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
|
|
|
@@ -127,6 +128,7 @@ class PODApiController(BaseController):
|
127
|
128
|
redirect(lurl('/document/%i'%(loNewNode.parent_id)))
|
128
|
129
|
|
129
|
130
|
@expose()
|
|
131
|
+ @require(can_read())
|
130
|
132
|
def get_file_content(self, node_id=None, **kw):
|
131
|
133
|
if node_id==None:
|
132
|
134
|
return
|
|
@@ -163,6 +165,7 @@ class PODApiController(BaseController):
|
163
|
165
|
return loResultBuffer.getvalue()
|
164
|
166
|
|
165
|
167
|
@expose()
|
|
168
|
+ @require(can_write())
|
166
|
169
|
def set_parent_node(self, node_id, new_parent_id, **kw):
|
167
|
170
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
168
|
171
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -175,6 +178,7 @@ class PODApiController(BaseController):
|
175
|
178
|
redirect(lurl('/document/%s'%(node_id)))
|
176
|
179
|
|
177
|
180
|
@expose()
|
|
181
|
+ @require(can_write())
|
178
|
182
|
def move_node_upper(self, node_id=0):
|
179
|
183
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
180
|
184
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -185,6 +189,7 @@ class PODApiController(BaseController):
|
185
|
189
|
redirect(lurl('/document/%s'%(node_id)))
|
186
|
190
|
|
187
|
191
|
@expose()
|
|
192
|
+ @require(can_write())
|
188
|
193
|
def move_node_lower(self, node_id=0):
|
189
|
194
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
190
|
195
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -220,6 +225,7 @@ class PODApiController(BaseController):
|
220
|
225
|
redirect(lurl('/document/%i'%(loNewNode.node_id)))
|
221
|
226
|
|
222
|
227
|
@expose()
|
|
228
|
+ @require(can_write())
|
223
|
229
|
def edit_status(self, node_id, node_status):
|
224
|
230
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
225
|
231
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -229,6 +235,7 @@ class PODApiController(BaseController):
|
229
|
235
|
redirect(lurl('/document/%s'%(node_id)))
|
230
|
236
|
|
231
|
237
|
@expose()
|
|
238
|
+ @require(can_write())
|
232
|
239
|
def edit_label_and_content(self, node_id, data_label, data_content):
|
233
|
240
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
234
|
241
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -239,6 +246,7 @@ class PODApiController(BaseController):
|
239
|
246
|
redirect(lurl('/document/%s'%(node_id)))
|
240
|
247
|
|
241
|
248
|
@expose()
|
|
249
|
+ @require(can_write())
|
242
|
250
|
def force_delete_node(self, node_id=None):
|
243
|
251
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
244
|
252
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|
|
@@ -270,6 +278,7 @@ class PODApiController(BaseController):
|
270
|
278
|
redirect(lurl('/document/%s'%(back_to_node_id)))
|
271
|
279
|
|
272
|
280
|
@expose()
|
|
281
|
+ @require(can_write())
|
273
|
282
|
def toggle_share_status(self, node_id):
|
274
|
283
|
loCurrentUser = pld.PODStaticController.getCurrentUser()
|
275
|
284
|
loApiController = pld.PODUserFilteredApiController(loCurrentUser.user_id)
|