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
7bdc997a
Commit
7bdc997a
authored
Jan 05, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed signature of hasRole to accept instance where role came from.
parent
47498241
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+2
-2
lib/python/OFS/Document.py
lib/python/OFS/Document.py
+6
-4
No files found.
lib/python/AccessControl/User.py
View file @
7bdc997a
"""Access control package"""
__version__
=
'$Revision: 1.3
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
1
$'
[
11
:
-
2
]
from
PersistentMapping
import
PersistentMapping
...
...
@@ -25,7 +25,7 @@ class User(Implicit, Persistent):
def
authenticate
(
self
,
password
):
return
password
==
self
.
__
def
hasRole
(
self
,
roles
=
None
):
def
hasRole
(
self
,
inst
,
roles
=
None
):
if
roles
is
None
:
return
1
for
role
in
roles
:
...
...
lib/python/OFS/Document.py
View file @
7bdc997a
"""Document object"""
__version__
=
'$Revision: 1.3
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
...
...
@@ -61,14 +61,16 @@ class Document(HTML, Explicit, RoleManager, Item_w__name__):
elif
inst
is
parent
:
return
1
else
:
if
str
(
name
)[:
6
]
==
'manage'
:
return
0
if
hasattr
(
parent
,
'__roles__'
):
roles
=
parent
.
__roles__
# if str(name)[:6]=='manage': return 0
if
hasattr
(
parent
,
'__roles__'
):
roles
=
parent
.
__roles__
elif
hasattr
(
parent
,
'aq_acquire'
):
try
:
roles
=
parent
.
aq_acquire
(
'__roles__'
)
except
AttributeError
:
return
0
else
:
return
0
value
=
parent
if
roles
is
None
:
return
1
try
:
return
md
.
AUTHENTICATED_USER
.
hasRole
(
roles
)
try
:
return
md
.
AUTHENTICATED_USER
.
hasRole
(
value
,
roles
)
except
AttributeError
:
return
0
manage_editForm
=
HTMLFile
(
'documentEdit'
,
globals
())
...
...
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