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
69201a89
Commit
69201a89
authored
Jan 15, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added security to User Folders (!)
parent
f14aa7b5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
30 deletions
+44
-30
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+39
-25
lib/python/AccessControl/addUser.dtml
lib/python/AccessControl/addUser.dtml
+1
-1
lib/python/AccessControl/editUser.dtml
lib/python/AccessControl/editUser.dtml
+1
-1
lib/python/AccessControl/mainUser.dtml
lib/python/AccessControl/mainUser.dtml
+3
-3
No files found.
lib/python/AccessControl/User.py
View file @
69201a89
"""Access control package"""
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
from
PersistentMapping
import
PersistentMapping
...
...
@@ -12,7 +12,8 @@ from Acquisition import Implicit
from
OFS.SimpleItem
import
Item
from
base64
import
decodestring
from
ImageFile
import
ImageFile
import
App.Undo
from
Role
import
RoleManager
import
Globals
,
App
.
Undo
...
...
@@ -72,9 +73,11 @@ nobody=User('Anonymous User','',('Anonymous',))
class
UserFolder
(
Implicit
,
Persistent
,
Navigation
,
Tabs
,
Item
,
App
.
Undo
.
UndoSupport
):
class
UserFolder
(
Implicit
,
Persistent
,
Navigation
,
Tabs
,
RoleManager
,
Item
,
App
.
Undo
.
UndoSupport
):
""" """
__roles__
=
[
'Manager'
,
'Shared'
]
meta_type
=
'User Folder'
id
=
'acl_users'
title
=
'User Folder'
...
...
@@ -85,12 +88,22 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
manage_options
=
(
{
'icon'
:
icon
,
'label'
:
'Contents'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
},
{
'icon'
:
'App/undo_icon.gif'
,
'label'
:
'Undo'
,
'action'
:
'manage_UndoForm'
,
'target'
:
'manage_main'
},
{
'label'
:
'Contents'
,
'action'
:
'manage_main'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
{
'label'
:
'Undo'
,
'action'
:
'manage_UndoForm'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage_menu'
,
'manage_main'
,
'manage_copyright'
,
'manage_tabs'
,
'manage_UndoForm'
]),
(
'Undo changes'
,
[
'manage_undo_transactions'
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Manage users'
,
[
'manage_users'
]),
(
'Shared permission'
,
[
''
]),
)
def
__init__
(
self
):
self
.
data
=
PersistentMapping
()
...
...
@@ -143,6 +156,8 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
_add_User
=
HTMLFile
(
'addUser'
,
globals
())
_editUser
=
HTMLFile
(
'editUser'
,
globals
())
manage
=
manage_main
=
_mainUser
def
_addUser
(
self
,
name
,
password
,
confirm
,
roles
,
REQUEST
=
None
):
if
not
name
or
not
password
or
not
confirm
:
return
MessageDialog
(
...
...
@@ -165,7 +180,7 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
message
=
'Shared is not a legal role name'
,
action
=
'manage_main'
)
self
.
data
[
name
]
=
User
(
name
,
password
,
roles
)
return
self
.
_mainUser
(
self
,
REQUEST
)
if
REQUEST
:
return
self
.
_mainUser
(
self
,
REQUEST
)
def
_changeUser
(
self
,
name
,
password
,
confirm
,
roles
,
REQUEST
=
None
):
if
not
name
or
not
password
or
not
confirm
:
...
...
@@ -191,9 +206,9 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
user
=
self
.
data
[
name
]
user
.
__
=
password
user
.
roles
=
roles
return
self
.
_mainUser
(
self
,
REQUEST
)
if
REQUEST
:
return
self
.
_mainUser
(
self
,
REQUEST
)
def
_delUser
(
self
,
names
,
REQUEST
=
None
):
def
_delUser
s
(
self
,
names
,
REQUEST
=
None
):
if
not
names
:
return
MessageDialog
(
title
=
'Illegal value'
,
...
...
@@ -207,9 +222,9 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
action
=
'manage_main'
)
for
name
in
names
:
del
self
.
data
[
name
]
return
self
.
_mainUser
(
self
,
REQUEST
)
if
REQUEST
:
return
self
.
_mainUser
(
self
,
REQUEST
)
def
manage_
main
(
self
,
submit
=
None
,
REQUEST
=
None
):
def
manage_
users
(
self
,
submit
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
):
""" """
if
submit
==
'Add...'
:
return
self
.
_add_User
(
self
,
REQUEST
)
...
...
@@ -238,12 +253,10 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
if
submit
==
'Delete'
:
names
=
reqattr
(
REQUEST
,
'names'
)
return
self
.
_delUser
(
names
,
REQUEST
)
return
self
.
_delUser
s
(
names
,
REQUEST
)
return
self
.
_mainUser
(
self
,
REQUEST
)
manage
=
manage_main
# Copy/Paste support
...
...
@@ -264,6 +277,7 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, Item,
'<EM>Cannot change the id of a UserFolder</EM>'
)
Globals
.
default__class_init__
(
UserFolder
)
class
UserFolderHandler
:
...
...
lib/python/AccessControl/addUser.dtml
View file @
69201a89
...
...
@@ -8,7 +8,7 @@
To add a new user, enter the name, password, confirmation and
roles for the new user and click "Add".
<FORM ACTION="manage_
main
" METHOD="POST">
<FORM ACTION="manage_
users
" METHOD="POST">
<TABLE>
<TR>
<TD VALIGN="TOP">
...
...
lib/python/AccessControl/editUser.dtml
View file @
69201a89
...
...
@@ -5,7 +5,7 @@
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<FORM ACTION="manage_
main
" METHOD="POST">
<FORM ACTION="manage_
users
" METHOD="POST">
<TABLE>
<TR>
<TD VALIGN="TOP">
...
...
lib/python/AccessControl/mainUser.dtml
View file @
69201a89
...
...
@@ -5,7 +5,7 @@
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<FORM ACTION="manage_
main
" METHOD="POST">
<FORM ACTION="manage_
users
" METHOD="POST">
<!--#if user_names-->
The following users have been defined. Click on a user to edit
that user.
...
...
@@ -17,11 +17,11 @@ that user.
<INPUT TYPE="CHECKBOX" NAME="names:list" VALUE="<!--#var sequence-item-->">
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<A HREF="manage_
main
?name=<!--#var sequence-item fmt=url-quote-->&submit=Edit">
<A HREF="manage_
users
?name=<!--#var sequence-item fmt=url-quote-->&submit=Edit">
<IMG SRC="<!--#var SCRIPT_NAME-->/p_/User_icon" ALT="Click to edit user"
BORDER="0">
</A>
<A HREF="manage_
main
?name=<!--#var sequence-item fmt=url-quote-->&submit=Edit">
<A HREF="manage_
users
?name=<!--#var sequence-item fmt=url-quote-->&submit=Edit">
<!--#var sequence-item-->
</A>
</TD>
...
...
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