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
5295f54a
Commit
5295f54a
authored
Feb 10, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-did the way permissions are handled in install_products, once
again.
parent
0ae6333c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+22
-21
No files found.
lib/python/OFS/Application.py
View file @
5295f54a
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Application support
$Id: Application.py,v 1.4
6 1998/02/06 00:25:28
jim Exp $'''
__version__
=
'$Revision: 1.4
6
$'
[
11
:
-
2
]
$Id: Application.py,v 1.4
7 1998/02/10 18:25:42
jim Exp $'''
__version__
=
'$Revision: 1.4
7
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
regex
,
sys
...
...
@@ -196,7 +196,7 @@ def install_products():
from
Folder
import
Folder
folder_permissions
=
{}
for
permission
,
names
in
Folder
.
__ac_permissions__
:
folder_permissions
[
permission
]
=
list
(
names
)
folder_permissions
[
permission
]
=
names
meta_types
=
list
(
Folder
.
dynamic_meta_types
)
...
...
@@ -216,8 +216,9 @@ def install_products():
continue
permissions
=
{}
for
permission
,
names
in
pgetattr
(
product
,
'
permissions
'
,
()):
for
permission
,
names
in
pgetattr
(
product
,
'
__ac_permissions__
'
,
()):
for
name
in
names
:
permissions
[
name
]
=
permission
new_permissions
=
{}
for
meta_type
in
pgetattr
(
product
,
'meta_types'
,
()):
if
product_name
==
'OFSP'
:
meta_types
.
insert
(
0
,
meta_type
)
...
...
@@ -262,32 +263,28 @@ def install_products():
if
not
hasattr
(
Folder
,
name
):
setattr
(
Folder
,
name
,
method
)
if
name
[
-
9
:]
==
'__roles__'
:
continue
# Just setting roles
if
name
[:
6
]
==
'manage'
and
not
hasattr
(
Folder
,
name
+
'__roles__'
):
Folder
.
__dict__
[
name
+
'__roles__'
]
=
'Manager'
,
if
permissions
.
has_key
(
name
):
if
(
permissions
.
has_key
(
name
)
and
not
folder_permissions
.
has_key
(
permissions
[
name
])):
permission
=
permissions
[
name
]
if
folder
_permissions
.
has_key
(
permission
):
folder
_permissions
[
permission
].
append
(
name
)
if
new
_permissions
.
has_key
(
permission
):
new
_permissions
[
permission
].
append
(
name
)
else
:
folder_permissions
[
permission
]
=
[
name
]
elif
name
[:
10
]
==
'manage_add'
:
folder_permissions
[
'Add objects'
].
append
(
name
)
new_permissions
[
permission
]
=
[
name
]
if
new_permissions
:
new_permissions
=
new_permissions
.
items
()
for
permission
,
names
in
new_permissions
:
folder_permissions
[
permission
]
=
names
new_permissions
.
sort
()
Folder
.
__dict__
[
'__ac_permissions__'
]
=
tuple
(
list
(
Folder
.
__ac_permissions__
)
+
new_permissions
)
misc_
=
pgetattr
(
product
,
'misc_'
,
{})
if
type
(
misc_
)
is
DictType
:
misc_
=
Misc_
(
product_name
,
misc_
)
Application
.
misc_
.
__dict__
[
product_name
]
=
misc_
permissions
=
[]
for
permission
,
name
in
Folder
.
__ac_permissions__
:
permissions
.
append
((
permission
,
folder_permissions
[
permission
]))
del
folder_permissions
[
permission
]
folder_permissions
=
folder_permissions
.
items
()
folder_permissions
.
sort
()
Folder
.
__dict__
[
'__ac_permissions__'
]
=
tuple
(
permissions
+
folder_permissions
)
Folder
.
dynamic_meta_types
=
tuple
(
meta_types
)
Globals
.
default__class_init__
(
Folder
)
...
...
@@ -378,6 +375,10 @@ class Misc_:
##############################################################################
#
# $Log: Application.py,v $
# Revision 1.47 1998/02/10 18:25:42 jim
# Re-did the way permissions are handled in install_products, once
# again.
#
# Revision 1.46 1998/02/06 00:25:28 jim
# Fixed bug in handling product permissions.
#
...
...
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