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
4957ab92
Commit
4957ab92
authored
Mar 22, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs in managing meta_type and the icon.
Added machinery for better permissions management.
parent
e15046bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+28
-4
No files found.
lib/python/ZClasses/ZClass.py
View file @
4957ab92
...
@@ -149,6 +149,7 @@ def PersistentClassDict(doc=None, meta_type=None):
...
@@ -149,6 +149,7 @@ def PersistentClassDict(doc=None, meta_type=None):
dict
[
'__doc__'
]
=
doc
dict
[
'__doc__'
]
=
doc
return
dict
return
dict
_marker
=
[]
class
ZClass
(
OFS
.
SimpleItem
.
SimpleItem
):
class
ZClass
(
OFS
.
SimpleItem
.
SimpleItem
):
"""Zope Class
"""Zope Class
"""
"""
...
@@ -250,6 +251,11 @@ class ZClass(OFS.SimpleItem.SimpleItem):
...
@@ -250,6 +251,11 @@ class ZClass(OFS.SimpleItem.SimpleItem):
if
durl
is
None
:
durl
=
REQUEST
[
'URL2'
]
if
durl
is
None
:
durl
=
REQUEST
[
'URL2'
]
REQUEST
[
'RESPONSE'
].
redirect
(
durl
+
'/manage_workspace'
)
REQUEST
[
'RESPONSE'
].
redirect
(
durl
+
'/manage_workspace'
)
def
zclass_builtins
(
self
):
r
=
find_builtins
(
self
.
_zclass_
).
keys
()
r
.
sort
()
def
zclass_candidate_view_actions
(
self
):
def
zclass_candidate_view_actions
(
self
):
r
=
{}
r
=
{}
...
@@ -271,9 +277,11 @@ class ZClass(OFS.SimpleItem.SimpleItem):
...
@@ -271,9 +277,11 @@ class ZClass(OFS.SimpleItem.SimpleItem):
r
.
sort
()
r
.
sort
()
return
r
return
r
def
getClassAttr
(
self
,
name
):
def
getClassAttr
(
self
,
name
,
default
=
_marker
):
r
=
self
.
_zclass_
.
__dict__
[
name
]
if
default
is
_marker
:
return
self
.
_zclass_
.
__dict__
[
name
]
return
r
try
:
return
self
.
_zclass_
.
__dict__
[
name
]
except
KeyError
:
return
default
def
setClassAttr
(
self
,
name
,
value
):
def
setClassAttr
(
self
,
name
,
value
):
c
=
self
.
_zclass_
c
=
self
.
_zclass_
...
@@ -297,6 +305,10 @@ class ZClass(OFS.SimpleItem.SimpleItem):
...
@@ -297,6 +305,10 @@ class ZClass(OFS.SimpleItem.SimpleItem):
r
.
sort
()
r
.
sort
()
return
r
return
r
def
ziconImage
(
self
,
REQUEST
,
RESPONSE
):
"Display a class icon"
return
self
.
_zclass_
.
ziconImage
.
index_html
(
REQUEST
,
RESPONSE
)
class
ZClassSheets
(
OFS
.
PropertySheets
.
PropertySheets
):
class
ZClassSheets
(
OFS
.
PropertySheets
.
PropertySheets
):
"Manage a collection of property sheets that provide ZClass management"
"Manage a collection of property sheets that provide ZClass management"
...
@@ -327,3 +339,15 @@ def findActions(klass, found):
...
@@ -327,3 +339,15 @@ def findActions(klass, found):
found
[
d
[
'action'
]]
=
1
found
[
d
[
'action'
]]
=
1
findActions
(
b
,
found
)
findActions
(
b
,
found
)
except
:
pass
except
:
pass
def
find_builtins
(
klass
,
found
=
None
):
if
found
is
None
:
found
=
{}
for
b
in
klass
.
__bases__
:
try
:
for
pname
,
actions
in
b
.
__ac_permissions__
:
for
action
in
actions
:
found
[
'action'
]
=
1
find_builtins
(
b
,
found
)
except
:
pass
return
found
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