Commit fc67cd99 authored by Shane Hathaway's avatar Shane Hathaway

Corrected some roles assertions and fixed a NameError in manage_logout.

parent a2884c39
......@@ -85,9 +85,9 @@
"""Standard management interface support
$Id: Management.py,v 1.41 2001/01/12 20:49:58 shane Exp $"""
$Id: Management.py,v 1.42 2001/01/13 15:01:55 shane Exp $"""
__version__='$Revision: 1.41 $'[11:-2]
__version__='$Revision: 1.42 $'[11:-2]
import sys, Globals, ExtensionClass, urllib
from Dialogs import MessageDialog
......@@ -214,20 +214,19 @@ class Navigation(ExtensionClass.Base):
manage_page_header=DTMLFile('dtml/manage_page_header', globals())
manage_page_footer=DTMLFile('dtml/manage_page_footer', globals())
manage_form_title__roles__=None
manage_form_title =DTMLFile('dtml/manage_form_title', globals(),
form_title='Add Form',
help_product=None,
help_topic=None)
manage_form_title._setFuncSignature(
varnames=('form_title', 'help_product', 'help_topic') )
manage_form_title.__roles__ = None
manage_copyright__roles__=None
manage_copyright=DTMLFile('dtml/copyright', globals())
manage_copyright.__roles__ = None
manage_logout__roles__=None
def manage_logout(self):
manage_logout__roles__ = None
def manage_logout(self, REQUEST=None):
"""Logout current user"""
p = getattr(REQUEST, '_logout_path', None)
if p is not None:
......@@ -239,11 +238,8 @@ Sorry, this is not yet implemented.
</body>
</html>"""
setattr(Navigation, 'manage_page_style.css',
DTMLFile('dtml/manage_page_style.css', globals())
)
setattr(Navigation, 'manage_page_style.css__roles__', None)
file = DTMLFile('dtml/manage_page_style.css', globals())
setattr(Navigation, 'manage_page_style.css', file)
file.__roles__ = None
Globals.default__class_init__(Navigation)
......@@ -99,10 +99,17 @@ def default__class_init__(self):
for name, v in dict_items:
if hasattr(v,'_need__name__') and v._need__name__:
v.__dict__['__name__']=name
if ((name=='manage' or name[:7]=='manage_') and
not hasattr(v, '__roles__')):
try: v.__roles__ = ('Manager',)
except: dict[name+'__roles__'] = ('Manager',)
if name=='manage' or name[:7]=='manage_':
if not hasattr(v, '__roles__'):
try: v.__roles__ = ('Manager',)
except:
# This attribute can't hold a __roles__
# attribute. Try to store __roles__ in the
# class instead.
nr = name + '__roles__'
if not have(nr):
try: dict[nr] = ('Manager',)
except: pass
# Look for a SecurityInfo object on the class. If found, call its
# apply() method to generate __ac_permissions__ for the class. We
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment