mtool = getToolByName(script, 'portal_membership')
checkPermission = mtool.checkPermission
+isAnon = mtool.isAnonymousUser()
utool = getToolByName(script, 'portal_url')
portal_url = utool()
else:
is_default = 0
-columns = ( {'key': 'Lock',
- 'title': '',
- 'width': '16',
- 'colspan': None}
- , {'key': 'Type',
+columns = ( {'key': 'Type',
'title': 'Type',
'width': None,
'colspan': '2'}
'title': 'Last Modified',
'width': None,
'colspan': None}
- # , {'key': 'position',
- # 'title': 'Position',
- # 'width': None,
- # 'colspan': None }
)
for column in columns:
items = sequence.sort( items, ((key, sortFunc, sort_dir),) )
batch_obj = Batch(items, context.default_batch_size, b_start, orphan=0, quantumleap=1)
items = []
-display_delete_button = True # TODO : à revoir
+display_delete_button = not isAnon # TODO : à revoir
for item in batch_obj:
item_icon = item.getIcon
item_id = item.getId
item_url = item.getURL()
- #try : item_delete_allowed = context.objectIdCanBeDeleted(item_id)
- #except : item_delete_allowed = checkPermission(DeleteObjects, context) # std zope perm
- #if not display_delete_button :
- # display_delete_button = item_delete_allowed
items.append(
- {'lock' : False,
- 'checkbox': True,
+ {'checkbox': not isAnon,
'icon': item_icon and ( '%s/%s' % (portal_url, item_icon) ) or '',
'id': item_id,
'modified': item.modified.strftime(locale_date_fmt),
'listHiddenVarInfos': tuple(hidden_vars),
'listButtonInfos': tuple(buttons),
'is_orderable': is_orderable,
- 'is_sortable': is_sortable }
+ 'is_sortable': is_sortable,
+ 'items_add_allowed': items_add_allowed }
if not ajax and is_orderable :
deltas = range( 1, min(5, length) ) + range(5, length, 5)
options['form']['listDeltas'] = tuple(deltas)