comparison MoinMoin/theme/__init__.py @ 3473:59a4005672d3

theme.__init__: action enabled dependent of rights
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 05 Apr 2008 11:48:47 +0200
parents 4abf8492a665
children f3c50edd219c
comparison
equal deleted inserted replaced
3472:4abf8492a665 3473:59a4005672d3
971 # revert action enabled only if user can revert 971 # revert action enabled only if user can revert
972 if action == 'revert' and not request.user.may.revert(page.page_name): 972 if action == 'revert' and not request.user.may.revert(page.page_name):
973 data['action'] = 'show' 973 data['action'] = 'show'
974 data['disabled'] = disabled 974 data['disabled'] = disabled
975 975
976 # SubscribeUser action enabled only if user has admin rights
977 if action == 'SubscribeUser' and not request.user.may.admin(page.page_name):
978 data['action'] = 'show'
979 data['disabled'] = disabled
980
981 # PackagePages action only if user has write rights
982 if action == 'PackagePages' and not request.user.may.write(page.page_name):
983 data['action'] = 'show'
984 data['disabled'] = disabled
985
986 # Despam action enabled only for superusers
987 if action == 'Despam' and not request.user.isSuperUser():
988 data['action'] = 'show'
989 data['disabled'] = disabled
990
976 # Special menu items. Without javascript, executing will 991 # Special menu items. Without javascript, executing will
977 # just return to the page. 992 # just return to the page.
978 elif action.startswith('__'): 993 if action.startswith('__'):
979 data['action'] = 'show' 994 data['action'] = 'show'
980 995
981 # Actions which are not available for this wiki, user or page 996 # Actions which are not available for this wiki, user or page
982 if (action == '__separator__' or 997 if (action == '__separator__' or
983 (action[0].isupper() and not action in available)): 998 (action[0].isupper() and not action in available)):