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
d0d9ec96
Commit
d0d9ec96
authored
Nov 18, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug that appeared after __roles__ were allowed to be acquired.
parent
90afc3b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
22 deletions
+17
-22
lib/python/AccessControl/Role.py
lib/python/AccessControl/Role.py
+17
-22
No files found.
lib/python/AccessControl/Role.py
View file @
d0d9ec96
"""Access control package"""
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
import
Globals
from
User
import
SafeDtml
...
...
@@ -15,9 +15,8 @@ class RoleManager:
smallRolesWidget
=
SafeDtml
(
'AccessControl/smallRolesWidget'
)
def
selectedRoles
(
self
):
try
:
roles
=
self
.
__roles__
try
:
roles
=
self
.
aq_self
.
__roles__
except
:
roles
=
[]
if
roles
is
None
:
roles
=
[]
return
map
(
lambda
i
,
r
=
roles
:
...
...
@@ -25,11 +24,15 @@ class RoleManager:
or
(
'<OPTION VALUE="%s">%s'
%
(
i
,
i
)),
self
.
validRoles
())
def
aclAChecked
(
self
):
if
hasattr
(
self
,
'aq_self'
):
self
=
self
.
aq_self
try
:
roles
=
self
.
__roles__
except
:
return
' CHECKED'
return
''
def
aclPChecked
(
self
):
if
hasattr
(
self
,
'aq_self'
):
self
=
self
.
aq_self
try
:
roles
=
self
.
__roles__
except
:
return
''
if
roles
is
None
:
...
...
@@ -37,6 +40,8 @@ class RoleManager:
return
''
def
aclEChecked
(
self
):
if
hasattr
(
self
,
'aq_self'
):
self
=
self
.
aq_self
try
:
roles
=
self
.
__roles__
except
:
return
0
if
roles
is
None
:
...
...
@@ -46,8 +51,9 @@ class RoleManager:
def
manage_editRoles
(
self
,
REQUEST
,
acl_type
=
'A'
,
acl_roles
=
[]):
""" """
try
:
del
self
.
__roles__
except
:
pass
if
hasattr
(
self
,
'aq_self'
):
try
:
del
self
.
aq_self
.
__roles__
except
:
pass
if
acl_type
==
'A'
:
return
self
.
manage_rolesForm
(
self
,
REQUEST
)
if
acl_type
==
'P'
:
...
...
@@ -59,25 +65,11 @@ class RoleManager:
return
self
.
manage_rolesForm
(
self
,
REQUEST
)
def
oldmanage_editRoles
(
self
,
REQUEST
,
roles
=
[]):
try
:
del
self
.
__roles__
except
:
pass
if
not
roles
:
return
self
.
manage_rolesForm
(
self
,
REQUEST
)
if
roles
==
[
'Public'
,]:
self
.
__roles__
=
None
return
self
.
manage_rolesForm
(
self
,
REQUEST
)
if
(
'Acquire'
in
roles
)
or
(
'Public'
in
roles
):
raise
'Bad Request'
,(
'<EM>Acquired</EM> and <EM>Public</EM> '
\
'cannot be combined with other roles!'
)
self
.
__roles__
=
roles
return
self
.
manage_rolesForm
(
self
,
REQUEST
)
def
_setRoles
(
self
,
acl_type
,
acl_roles
):
# Non-web helper to correctly set roles
try
:
del
self
.
__roles__
except
:
pass
if
hasattr
(
self
,
'aq_self'
):
try
:
del
self
.
aq_self
.
__roles__
except
:
pass
if
acl_type
==
'A'
:
return
if
acl_type
==
'P'
:
...
...
@@ -91,6 +83,9 @@ class RoleManager:
# $Log: Role.py,v $
# Revision 1.6 1997/11/18 21:48:20 brian
# Fixed bug that appeared after __roles__ were allowed to be acquired.
#
# Revision 1.5 1997/11/07 17:10:03 brian
# Moved validRoles manage_addRole and manage_deleteRole to app object
#
...
...
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