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
55029eb6
Commit
55029eb6
authored
Sep 19, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed UFs so that only the top UF validates god.
parent
02994d98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+16
-7
No files found.
lib/python/AccessControl/User.py
View file @
55029eb6
"""Access control package"""
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
import
Globals
from
Persistence
import
Persistent
...
...
@@ -71,7 +71,7 @@ class SuperUser:
def
__repr__
(
self
):
return
self
.
_name
su
=
SuperUser
()
su
per
=
SuperUser
()
class
UserFolder
(
Implicit
,
Persistent
,
Item
):
...
...
@@ -94,8 +94,6 @@ class UserFolder(Implicit, Persistent, Item):
manage_options
=
(
{
'icon'
:
'AccessControl/UserFolder_icon.gif'
,
'label'
:
'Contents'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
},
# {'icon':'OFS/Help_icon.gif', 'label':'Help',
# 'action':'manage_help', 'target':'_new'},
)
def
_init
(
self
):
...
...
@@ -108,6 +106,11 @@ class UserFolder(Implicit, Persistent, Item):
try
:
return
(
self
.
aq_parent
,)
except
:
return
()
def
_isTop
(
self
):
try
:
t
=
self
.
aq_parent
.
aq_parent
.
acl_users
except
:
return
1
return
0
def
userNames
(
self
):
return
self
.
_data
.
keys
()
...
...
@@ -118,8 +121,11 @@ class UserFolder(Implicit, Persistent, Item):
if
lower
(
auth
[:
6
])
!=
'basic '
:
return
None
[
name
,
password
]
=
split
(
decodestring
(
split
(
auth
)[
-
1
]),
':'
)
if
(
name
==
su
.
_name
)
and
(
password
==
su
.
_password
):
return
su
if
self
.
_isTop
()
and
(
name
==
super
.
_name
)
and
\
(
password
==
super
.
_password
):
return
super
try
:
user
=
self
.
_data
[
name
]
except
:
return
None
if
password
!=
user
.
_password
:
...
...
@@ -133,7 +139,7 @@ class UserFolder(Implicit, Persistent, Item):
def
manage_addUser
(
self
,
REQUEST
,
name
,
password
,
confirm
,
roles
=
[]):
""" """
if
self
.
_data
.
has_key
(
name
):
if
self
.
_data
.
has_key
(
name
)
or
(
name
==
super
.
_name
)
:
return
MessageDialog
(
title
=
'Illegal value'
,
message
=
'An item with the specified name already exists'
,
action
=
'%s/manage'
%
REQUEST
[
'PARENT_URL'
])
...
...
@@ -228,6 +234,9 @@ class UserFolderHandler:
# $Log: User.py,v $
# Revision 1.13 1997/09/19 17:52:04 brian
# Changed UFs so that only the top UF validates god.
#
# Revision 1.12 1997/09/17 14:59:42 brian
# *** empty log message ***
#
...
...
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