Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
preetwinder
erp5
Commits
c4886de0
Commit
c4886de0
authored
Jan 08, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLCatalog: cleanup duplicate security declarations.
parent
8316dcce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
39 deletions
+14
-39
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+5
-16
product/ZSQLCatalog/ZSQLCatalog.py
product/ZSQLCatalog/ZSQLCatalog.py
+9
-23
No files found.
product/ZSQLCatalog/SQLCatalog.py
View file @
c4886de0
...
...
@@ -23,7 +23,7 @@ from thread import allocate_lock, get_ident
from
OFS.Folder
import
Folder
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.Permissions
import
access_contents_information
,
\
manage_zcatalog_entries
import_export_objects
,
manage_zcatalog_entries
from
AccessControl.SimpleObjectPolicies
import
ContainerAssertions
from
BTrees.OIBTree
import
OIBTree
from
App.config
import
getConfiguration
...
...
@@ -357,17 +357,10 @@ class Catalog(Folder,
__ac_permissions__
=
(
(
'Manage ZCatalog Entries'
,
[
'manage_catalogObject'
,
'manage_uncatalogObject'
,
'manage_catalogView'
,
'manage_catalogFind'
,
[
'manage_catalogView'
,
'manage_catalogFind'
,
'manage_catalogFilter'
,
'manage_catalogAdvanced'
,
'manage_catalogReindex'
,
'manage_catalogFoundItems'
,
'manage_catalogClear'
,
'manage_main'
,
'manage_editFilter'
,
],
'manage_main'
,],
[
'Manager'
]),
(
'Search ZCatalog'
,
...
...
@@ -377,10 +370,6 @@ class Catalog(Folder,
'getFilterableMethodList'
,],
[
'Anonymous'
,
'Manager'
]),
(
'Import/Export objects'
,
[
'manage_exportProperties'
,
'manage_importProperties'
,
],
[
'Manager'
]),
)
_properties
=
(
...
...
@@ -714,7 +703,7 @@ class Catalog(Folder,
local_role_key_dict
[
role
.
strip
()]
=
column
.
strip
()
return
local_role_key_dict
.
items
()
security
.
declareProtected
(
manage_zcatalog_entrie
s
,
'manage_exportProperties'
)
security
.
declareProtected
(
import_export_object
s
,
'manage_exportProperties'
)
def
manage_exportProperties
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
):
"""
Export properties to an XML file.
...
...
@@ -774,7 +763,7 @@ class Catalog(Folder,
'inline;filename=properties.xml'
)
return
f
.
getvalue
()
security
.
declareProtected
(
manage_zcatalog_entrie
s
,
'manage_importProperties'
)
security
.
declareProtected
(
import_export_object
s
,
'manage_importProperties'
)
def
manage_importProperties
(
self
,
file
):
"""
Import properties from an XML file.
...
...
product/ZSQLCatalog/ZSQLCatalog.py
View file @
c4886de0
...
...
@@ -24,7 +24,8 @@ from Persistence import Persistent
from
DocumentTemplate.DT_Util
import
InstanceDict
,
TemplateDict
from
DocumentTemplate.DT_Util
import
Eval
from
AccessControl.Permission
import
name_trans
from
AccessControl.Permissions
import
manage_zcatalog_entries
from
AccessControl.Permissions
import
import_export_objects
,
\
manage_zcatalog_entries
from
SQLCatalog
import
CatalogError
from
AccessControl
import
ClassSecurityInfo
from
DocumentTemplate.security
import
RestrictedDTML
...
...
@@ -121,22 +122,11 @@ class ZCatalog(Folder, Persistent, Implicit):
__ac_permissions__
=
(
(
'Manage ZCatalog Entries'
,
[
'manage_catalogObject'
,
'manage_uncatalogObject'
,
'catalog_object'
,
'uncatalog_object'
,
'refreshCatalog'
,
'manage_catalogView'
,
'manage_catalogFind'
,
[
'manage_catalogView'
,
'manage_catalogFind'
,
'manage_catalogSchema'
,
'manage_catalogFilter'
,
'manage_catalogAdvanced'
,
'manage_objectInformation'
,
'manage_catalogHotReindexing'
,
'manage_catalogReindex'
,
'manage_catalogFoundItems'
,
'manage_catalogClear'
,
'manage_editSchema'
,
'manage_main'
,
'manage_editFilter'
,
'manage_hotReindexAll'
,
],
'manage_main'
,],
[
'Manager'
]),
(
'Search ZCatalog'
,
...
...
@@ -147,10 +137,6 @@ class ZCatalog(Folder, Persistent, Implicit):
'getCatalogSearchResultKeys'
,
'getFilterableMethodList'
,
],
[
'Anonymous'
,
'Manager'
]),
(
'Import/Export objects'
,
[
'manage_catalogExportProperties'
,
'manage_catalogImportProperties'
,
],
[
'Manager'
]),
)
_properties
=
(
...
...
@@ -227,7 +213,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return
self
.
_getOb
(
id
,
default_value
)
security
.
declareProtected
(
manage_zcatalog_entrie
s
,
'manage_catalogExportProperties'
)
security
.
declareProtected
(
import_export_object
s
,
'manage_catalogExportProperties'
)
def
manage_catalogExportProperties
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
,
sql_catalog_id
=
None
):
"""
Export properties to an XML file.
...
...
@@ -236,7 +222,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if
catalog
is
not
None
:
return
catalog
.
manage_exportProperties
(
REQUEST
=
REQUEST
,
RESPONSE
=
RESPONSE
)
security
.
declareProtected
(
manage_zcatalog_entrie
s
,
'manage_catalogImportProperties'
)
security
.
declareProtected
(
import_export_object
s
,
'manage_catalogImportProperties'
)
def
manage_catalogImportProperties
(
self
,
file
,
sql_catalog_id
=
None
):
"""
Import properties from an XML file.
...
...
@@ -592,7 +578,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if
catalog
is
not
None
:
catalog
.
manage_catalogReindex
(
REQUEST
,
RESPONSE
,
URL1
,
urls
=
urls
)
security
.
declarePr
ivate
(
'refreshCatalog'
)
security
.
declarePr
otected
(
manage_zcatalog_entries
,
'refreshCatalog'
)
def
refreshCatalog
(
self
,
clear
=
0
,
sql_catalog_id
=
None
):
""" re-index everything we can find """
...
...
@@ -716,7 +702,7 @@ class ZCatalog(Folder, Persistent, Implicit):
#LOG('ZSQLCatalog wrapObject', 0, 'object = %r, kw = %r' % (object, kw))
return
object
security
.
declarePr
ivate
(
'catalog_object'
)
security
.
declarePr
otected
(
manage_zcatalog_entries
,
'catalog_object'
)
def
catalog_object
(
self
,
obj
,
url
=
None
,
idxs
=
[],
is_object_moved
=
0
,
sql_catalog_id
=
None
,
**
kw
):
""" wrapper around catalog """
self
.
catalogObjectList
([
obj
],
sql_catalog_id
=
sql_catalog_id
)
...
...
@@ -866,7 +852,7 @@ class ZCatalog(Folder, Persistent, Implicit):
object_list
[:]
=
failed_object_list
security
.
declarePr
ivate
(
'uncatalog_object'
)
security
.
declarePr
otected
(
manage_zcatalog_entries
,
'uncatalog_object'
)
def
uncatalog_object
(
self
,
uid
=
None
,
path
=
None
,
sql_catalog_id
=
None
):
""" wrapper around catalog """
if
uid
is
None
:
...
...
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