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
df7e95ab
Commit
df7e95ab
authored
May 08, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More debugging of "shared" roles support. Waaaaaa.
parent
eae39718
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+14
-11
No files found.
lib/python/AccessControl/User.py
View file @
df7e95ab
"""Access control package"""
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
9
$'
[
11
:
-
2
]
from
PersistentMapping
import
PersistentMapping
...
...
@@ -29,11 +29,7 @@ class User(Implicit, Persistent):
def
_shared_roles
(
self
,
parent
):
r
=
[]
while
1
:
if
hasattr
(
parent
,
'aq_parent'
):
while
hasattr
(
parent
.
aq_self
,
'aq_self'
):
parent
=
parent
.
aq_self
parent
=
parent
.
aq_parent
else
:
return
r
if
hasattr
(
parent
,
'__roles__'
):
roles
=
parent
.
__roles__
if
roles
is
None
:
return
'Anonymous'
,
if
'Shared'
in
roles
:
...
...
@@ -43,6 +39,11 @@ class User(Implicit, Persistent):
else
:
try
:
return
r
+
list
(
roles
)
except
:
return
r
if
hasattr
(
parent
,
'aq_parent'
):
while
hasattr
(
parent
.
aq_self
,
'aq_self'
):
parent
=
parent
.
aq_self
parent
=
parent
.
aq_parent
else
:
return
r
def
allowed
(
self
,
parent
,
roles
=
None
):
usr_roles
=
self
.
roles
...
...
@@ -64,7 +65,9 @@ class User(Implicit, Persistent):
if
'Shared'
in
roles
:
# Damn, old role setting. Waaa
roles
=
self
.
_shared_roles
(
parent
)
if
'Anonymous'
in
roles
:
return
1
if
roles
is
None
or
'Anonymous'
in
roles
:
return
1
while
'Shared'
in
roles
:
roles
.
remove
(
'Shared'
)
return
self
.
allowed
(
parent
,
roles
)
return
None
...
...
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