Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ee151ecb
Commit
ee151ecb
authored
Mar 28, 2005
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to handle acquired methods.
parent
a745b13f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lib/python/AccessControl/ZopeSecurityPolicy.py
lib/python/AccessControl/ZopeSecurityPolicy.py
+7
-1
No files found.
lib/python/AccessControl/ZopeSecurityPolicy.py
View file @
ee151ecb
...
@@ -14,14 +14,17 @@
...
@@ -14,14 +14,17 @@
$Id$"""
$Id$"""
from
types
import
MethodType
# AccessControl.Implementation inserts ZopeSecurityPolicy, getRoles
# AccessControl.Implementation inserts:
# ZopeSecurityPolicy, getRoles, rolesForPermissionOn
from
AccessControl.SimpleObjectPolicies
import
_noroles
from
AccessControl.SimpleObjectPolicies
import
_noroles
rolesForPermissionOn
=
None
# XXX: avoid import loop
rolesForPermissionOn
=
None
# XXX: avoid import loop
tuple_or_list
=
tuple
,
list
tuple_or_list
=
tuple
,
list
def
getRoles
(
container
,
name
,
value
,
default
):
def
getRoles
(
container
,
name
,
value
,
default
):
global
rolesForPermissionOn
# XXX: avoid import loop
global
rolesForPermissionOn
# XXX: avoid import loop
...
@@ -34,6 +37,9 @@ def getRoles(container, name, value, default):
...
@@ -34,6 +37,9 @@ def getRoles(container, name, value, default):
if
not
name
or
not
isinstance
(
name
,
basestring
):
if
not
name
or
not
isinstance
(
name
,
basestring
):
return
default
return
default
if
type
(
value
)
is
MethodType
:
container
=
value
.
im_self
cls
=
getattr
(
container
,
'__class__'
,
None
)
cls
=
getattr
(
container
,
'__class__'
,
None
)
if
cls
is
None
:
if
cls
is
None
:
return
default
return
default
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment