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
2270bb63
Commit
2270bb63
authored
May 08, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified default class init to work with new permission machinery.
parent
a5adc9aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
lib/python/Globals.py
lib/python/Globals.py
+22
-1
No files found.
lib/python/Globals.py
View file @
2270bb63
"""Global definitions"""
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
import
sys
,
os
from
string
import
atof
,
rfind
...
...
@@ -23,7 +23,11 @@ except:
from
SingleThreadedTransaction
import
PickleDictionary
,
Persistent
import
DocumentTemplate
,
MethodObject
from
AccessControl.PermissionRole
import
PermissionRole
class
ApplicationDefaultPermissions
:
_View_Permission
=
'Manager'
,
'Anonymous'
def
default__class_init__
(
self
):
dict
=
self
.
__dict__
have
=
dict
.
has_key
...
...
@@ -38,6 +42,20 @@ def default__class_init__(self):
name
=
name
+
'__roles__'
if
not
have
(
name
):
dict
[
name
]
=
'Manager'
,
if
hasattr
(
self
,
'__ac_permissions__'
):
for
acp
in
self
.
__ac_permissions__
:
pname
,
mnames
=
acp
[:
2
]
pr
=
PermissionRole
(
pname
)
for
mname
in
mnames
:
try
:
getattr
(
self
,
mname
).
__roles__
=
pr
except
:
dict
[
mname
+
'__roles__'
]
=
pr
pname
=
pr
.
_p
if
not
hasattr
(
ApplicationDefaultPermissions
,
pname
):
if
len
(
acp
)
>
2
:
setattr
(
ApplicationDefaultPermissions
,
pname
,
acp
[
2
])
else
:
setattr
(
ApplicationDefaultPermissions
,
pname
,
(
'Manager'
,))
Persistent
.
__dict__
[
'__class_init__'
]
=
default__class_init__
class
HTML
(
DocumentTemplate
.
HTML
,
Persistent
,):
...
...
@@ -90,6 +108,9 @@ else:
# Log
#
# $Log: Globals.py,v $
# Revision 1.13 1998/05/08 14:52:20 jim
# Modified default class init to work with new permission machinery.
#
# Revision 1.12 1998/01/08 17:38:03 jim
# Added class initialization machinery to:
#
...
...
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