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
ab919171
Commit
ab919171
authored
Jul 04, 2009
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- import permissions from AccessControl.Permissions
parent
cb45cbcc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
+7
-8
src/Products/ZCTextIndex/ZCTextIndex.py
src/Products/ZCTextIndex/ZCTextIndex.py
+5
-3
No files found.
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
View file @
ab919171
...
...
@@ -17,6 +17,8 @@ $Id$
import
os
from
AccessControl.Permissions
import
manage_zcatalog_indexes
from
AccessControl.Permissions
import
view
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
App.class_init
import
InitializeClass
from
App.Common
import
package_home
...
...
@@ -38,9 +40,6 @@ from Products.PluginIndexes.interfaces import IDateRangeIndex
_dtmldir
=
os
.
path
.
join
(
package_home
(
globals
()
),
'dtml'
)
VIEW_PERMISSION
=
'View'
INDEX_MGMT_PERMISSION
=
'Manage ZCatalogIndex Entries'
class
DateRangeIndex
(
UnIndex
):
...
...
@@ -88,13 +87,13 @@ class DateRangeIndex(UnIndex):
self
.
_edit
(
since_field
,
until_field
)
self
.
clear
()
security
.
declareProtected
(
VIEW_PERMISSION
,
'getSinceField'
)
security
.
declareProtected
(
view
,
'getSinceField'
)
def
getSinceField
(
self
):
"""Get the name of the attribute indexed as start date.
"""
return
self
.
_since_field
security
.
declareProtected
(
VIEW_PERMISSION
,
'getUntilField'
)
security
.
declareProtected
(
view
,
'getUntilField'
)
def
getUntilField
(
self
):
"""Get the name of the attribute indexed as end date.
"""
...
...
@@ -102,7 +101,7 @@ class DateRangeIndex(UnIndex):
manage_indexProperties
=
DTMLFile
(
'manageDateRangeIndex'
,
_dtmldir
)
security
.
declareProtected
(
INDEX_MGMT_PERMISSION
,
'manage_edit'
)
security
.
declareProtected
(
manage_zcatalog_indexes
,
'manage_edit'
)
def
manage_edit
(
self
,
since_field
,
until_field
,
REQUEST
):
"""
"""
...
...
@@ -120,7 +119,7 @@ class DateRangeIndex(UnIndex):
self
.
_since_field
=
since_field
self
.
_until_field
=
until_field
security
.
declareProtected
(
INDEX_MGMT_PERMISSION
,
'clear'
)
security
.
declareProtected
(
manage_zcatalog_indexes
,
'clear'
)
def
clear
(
self
):
"""
Start over fresh.
...
...
@@ -303,7 +302,7 @@ class DateRangeIndex(UnIndex):
#
# ZCatalog needs this, although it isn't (yet) part of the interface.
#
security
.
declareProtected
(
VIEW_PERMISSION
,
'numObjects'
)
security
.
declareProtected
(
view
,
'numObjects'
)
def
numObjects
(
self
):
""" """
return
len
(
self
.
_unindex
)
...
...
src/Products/ZCTextIndex/ZCTextIndex.py
View file @
ab919171
...
...
@@ -18,9 +18,11 @@ $Id$
from
cgi
import
escape
from
AccessControl.
SecurityInfo
import
ClassSecurityInfo
from
AccessControl.
Permissions
import
manage_vocabulary
from
AccessControl.Permissions
import
manage_zcatalog_indexes
from
AccessControl.Permissions
import
query_vocabulary
from
AccessControl.Permissions
import
search_zcatalog
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
Acquisition
import
aq_base
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_parent
...
...
@@ -316,8 +318,8 @@ def manage_addLexicon(self, id, title='', elements=[], REQUEST=None):
# I am borrowing the existing vocabulary permissions for now to avoid
# adding new permissions. This may change when old style Vocabs go away
LexiconQueryPerm
=
'Query Vocabulary'
LexiconMgmtPerm
=
'Manage Vocabulary'
LexiconQueryPerm
=
query_vocabulary
LexiconMgmtPerm
=
manage_vocabulary
class
PLexicon
(
Lexicon
,
Implicit
,
SimpleItem
):
...
...
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