Commit 80e58b0e authored by Jim Fulton's avatar Jim Fulton

Changed rule (and terminology) for acquiring authorization data

so that a subobject can aquire data from a container even if an
intervening object does not use named groups.

Added better string formating of requests.
parent a9c09bb3
...@@ -136,22 +136,16 @@ Access Control ...@@ -136,22 +136,16 @@ Access Control
'__allow_groups__' attribute for a subobject overides '__allow_groups__' attribute for a subobject overides
'__allow_groups__' attributes for containing objects, however, if '__allow_groups__' attributes for containing objects, however, if
named groups are used, group data from containing objects may be named groups are used, group data from containing objects may be
inherited by contained objects. If a published object uses named acquired by contained objects. If a published object uses named
groups, then for each named group in the published object, group groups, then for each named group in the published object, group
data from groups with the same name in container objects will be data from groups with the same name in container objects will be
inherited from container objects if: acquired from container objects.
- The contained object uses named groups,
- There is no object that is a sub-object of the container
object, is a container of the published object, and that has
unnamed groups.
If the name of a group is the python object, 'None', then data from If the name of a group is the python object, 'None', then data from
named groups in container objects will be inherited even if the named groups in container objects will be acquired even if the
groupd don't appear in the inheriting object, subject to the group names don't appear in the acquiring object.
restrictions above.
When group data are inherited, then inherited data is appended to When group data are acquired, then acquired data is appended to
the existing data. When groups contain names and passwords, the existing data. When groups contain names and passwords,
individual user names may have multiple passwords if they appear in individual user names may have multiple passwords if they appear in
multiple groups. multiple groups.
...@@ -182,7 +176,7 @@ Access Control ...@@ -182,7 +176,7 @@ Access Control
name to password mappings contained in an object's name to password mappings contained in an object's
'__allow_groups__' attribute will be used. '__allow_groups__' attribute will be used.
An object may "inherit" a realm from one of it's parent An object may "acquir" a realm from one of it's parent
objects in the URI path to the object, including the module objects in the URI path to the object, including the module
used to publish the object. used to publish the object.
...@@ -522,7 +516,7 @@ Publishing a module using the ILU Requestor (future) ...@@ -522,7 +516,7 @@ Publishing a module using the ILU Requestor (future)
o Configure the web server to call module_name@server_name with o Configure the web server to call module_name@server_name with
the requestor. the requestor.
$Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $""" $Id: Publish.py,v 1.24 1996/10/29 19:21:43 jim Exp $"""
#' #'
# Copyright # Copyright
# #
...@@ -575,6 +569,13 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $""" ...@@ -575,6 +569,13 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $"""
# (540) 371-6909 # (540) 371-6909
# #
# $Log: Publish.py,v $ # $Log: Publish.py,v $
# Revision 1.24 1996/10/29 19:21:43 jim
# Changed rule (and terminology) for acquiring authorization data
# so that a subobject can aquire data from a container even if an
# intervening object does not use named groups.
#
# Added better string formating of requests.
#
# Revision 1.23 1996/10/28 22:13:45 jim # Revision 1.23 1996/10/28 22:13:45 jim
# Fixed bug in last fix. # Fixed bug in last fix.
# #
...@@ -606,7 +607,7 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $""" ...@@ -606,7 +607,7 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $"""
# Added: # Added:
# #
# - Regex, regex input types, # - Regex, regex input types,
# - New rule for inheriting allow groups, # - New rule for acquiring allow groups,
# - Support for index_html attribute, # - Support for index_html attribute,
# - Support for relative base refs # - Support for relative base refs
# - Added URL as magic variable # - Added URL as magic variable
...@@ -673,7 +674,7 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $""" ...@@ -673,7 +674,7 @@ $Id: Publish.py,v 1.23 1996/10/28 22:13:45 jim Exp $"""
# #
# #
# #
__version__='$Revision: 1.23 $'[11:-2] __version__='$Revision: 1.24 $'[11:-2]
def main(): def main():
...@@ -805,8 +806,7 @@ class ModulePublisher: ...@@ -805,8 +806,7 @@ class ModulePublisher:
inherited_groups=default_inherited_groups inherited_groups=default_inherited_groups
try: try:
groups=theModule.__allow_groups__ groups=theModule.__allow_groups__
inherited_groups=allow_group_composition( inherited_groups=allow_group_composition(inherited_groups,groups)
inherited_groups,groups,default_inherited_groups)
except: groups=None except: groups=None
# Get a nice clean path list: # Get a nice clean path list:
...@@ -861,14 +861,13 @@ class ModulePublisher: ...@@ -861,14 +861,13 @@ class ModulePublisher:
try: try:
groups=subobject.__allow_groups__ groups=subobject.__allow_groups__
inherited_groups=allow_group_composition( inherited_groups=allow_group_composition(
inherited_groups,groups,default_inherited_groups) inherited_groups,groups)
except: except:
try: try:
groups=getattr(object, groups=getattr(object,
entry_name+'__allow_groups__') entry_name+'__allow_groups__')
inherited_groups=allow_group_composition( inherited_groups=allow_group_composition(
inherited_groups,groups, inherited_groups,groups)
default_inherited_groups)
except: pass except: pass
try: doc=subobject.__doc__ try: doc=subobject.__doc__
except: except:
...@@ -913,14 +912,12 @@ class ModulePublisher: ...@@ -913,14 +912,12 @@ class ModulePublisher:
try: try:
groups=subobject.__allow_groups__ groups=subobject.__allow_groups__
inherited_groups=allow_group_composition( inherited_groups=allow_group_composition(
inherited_groups,groups, inherited_groups,groups)
default_inherited_groups)
except: except:
try: try:
groups=object[entry_name+'__allow_groups__'] groups=object[entry_name+'__allow_groups__']
inherited_groups=allow_group_composition( inherited_groups=allow_group_composition(
inherited_groups,groups, inherited_groups,groups)
default_inherited_groups)
except: pass except: pass
try: doc=subobject.__doc__ try: doc=subobject.__doc__
except: except:
...@@ -1269,9 +1266,22 @@ class Request: ...@@ -1269,9 +1266,22 @@ class Request:
__http_colon=regex.compile("\(:\|\(%3[aA]\)\)") __http_colon=regex.compile("\(:\|\(%3[aA]\)\)")
def __str__(self): def __str__(self):
def str(self,name):
dict=getattr(self,name)
return "%s:\n\t%s\n\n" % (
name,
string.joinfields(
map(lambda k, d=dict: "%s: %s" % (k, d[k]), dict.keys()),
"\n\t"
)
)
return "%s\n%s\n%s\n%s" % ( return "%s\n%s\n%s\n%s" % (
str(self.other),str(self.form),str(self.environ),str(self.cookies)) str(self,'other'),str(self,'form'),str(self,'environ'),
str(self,'cookies'))
__repr__=__str__ __repr__=__str__
......
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