comparison MoinMoin/action/AttachFile.py @ 3595:1dcf6a261c2a

AttachFile: make error msg less confusing when trying to overwrite a file attachment without having acl delete rights
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 12 May 2008 23:39:36 +0200
parents 15e5ca7240ab
children 43aa566b0ec7
comparison
equal deleted inserted replaced
3592:ff60ed56002a 3595:1dcf6a261c2a
568 try: 568 try:
569 overwrite = int(overwrite) 569 overwrite = int(overwrite)
570 except: 570 except:
571 overwrite = 0 571 overwrite = 0
572 572
573 if (overwrite or not request.user.may.write(pagename)) and \ 573 if not request.user.may.write(pagename):
574 (not overwrite or not request.user.may.write(pagename) or not request.user.may.delete(pagename)):
575 return _('You are not allowed to attach a file to this page.') 574 return _('You are not allowed to attach a file to this page.')
575
576 if overwrite and not request.user.may.delete(pagename):
577 return _('You are not allowed to overwrite a file attachment of this page.')
576 578
577 filename = form.get('file__filename__') 579 filename = form.get('file__filename__')
578 rename = form.get('rename', [u''])[0].strip() 580 rename = form.get('rename', [u''])[0].strip()
579 if rename: 581 if rename:
580 target = rename 582 target = rename